Programatically scrolling a container

  • Thread starter Thread starter JezB
  • Start date Start date
J

JezB

I want a container in which I can control the scrolling programatically. So
it will act like a "window" on top of a larger canvas, with my code
controlling where the window is on the canvas. I don't think Panel will do
the job since you can't set DisplayRectangle programatically.

Any advice ?
 
JezB said:
I want a container in which I can control the scrolling programatically. So
it will act like a "window" on top of a larger canvas, with my code
controlling where the window is on the canvas. I don't think Panel will do
the job since you can't set DisplayRectangle programatically.

Scrollable container controls have an 'AutoScrollPosition' property which
can be used to control the viewport area.
 
Thanks. Now I just have to work out how this AutoScrollPosition works. Tried
the MSDN documentation and can't work it out ! You set +ve values and it
returns -ve? sheesh.
 
Seems this does NOT work properly when you turn the scrollbars off on the
panel (AutoScroll=false). It does up to a point, but at a certain point it
stops scrolling as it is told to! Turn AutoScroll on again and it does, but
I really don't want to display scroll bars!
 
Back
Top