How to simulate the auto scroll event in Panel?

G

Guest

Can anyone tell me how to set the position of the auto-scrollbars in a Panel dynamicall
I'm developing an Image Viewer. I have a picturebox control inside a panel, this picture contains an image bigger than the panel making the panel autoscroll. I need to scroll to a certain section of the image thro code,s so that the user doesnt hav e to move the scrollbars. Is there any way to acheive this kind of functionality
 
H

Herfried K. Wagner [MVP]

* "=?Utf-8?B?U2FjaGluIFRlbmR1bGthcg==?= said:
Can anyone tell me how to set the position of the auto-scrollbars in a
Panel dynamically

Set the panel's 'AutoScrollPosition' property.
 
G

Guest

thanx Hirf!! ... we tried it already but the problem is
when we do that not only the scrollbar seems to have moved from its initial position but the actual picture box control inside the panel also shifts from its original position this doesn't give us the scrolling effect.
We want the picturebox to stay in its location and only the panel scrollbar should move (or rather scroll) this will give us the desired scroll effect (also we cant afford to change the anchor property of the picture box


----- Herfried K. Wagner [MVP] wrote: ----

* "=?Utf-8?B?U2FjaGluIFRlbmR1bGthcg==?= said:
Can anyone tell me how to set the position of the auto-scrollbars in
Panel dynamicall

Set the panel's 'AutoScrollPosition' property
 
G

Guest

The AutoScrollPosition should be set with the opposite value (If you set -10, you will get 10).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top