How to simulate the auto scroll event in Panel?

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
* "=?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.
 
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
 
The AutoScrollPosition should be set with the opposite value (If you set -10, you will get 10).
 
Back
Top