Groups | Blog | Home
all groups > vb.net controls > july 2006 >

vb.net controls : Autoscroll Events


Keith G
7/25/2006 1:19:02 AM
VS2003 using VB.Net

I have a form with Autoscroll enabled and a Panel in the top left hand corner.
When the Form is scrolled I would like to keep the Panel visible (as it
contains other controls), in other words the Panel's location should always
be 0,0 relative to the forms visible rectangle.
I thought this would be a 'piece of cake' - just utilise the Form's
Autoscroll Event to reposition the Panel when the scrollbar is moved.
Only to find there isn't an Autoscroll Event!
I can get this to work if I use the Form's OnPaint Event but this creates
unpredicable behaviour because moving the Panel re-triggers the OnPaint Event.

There must be a simple answer but after several hours of trying, this has
eluded me.

Can anyone point me in the right direction?
Thanks in advance.
Keith G
7/25/2006 1:25:02 AM
I forgot to add - this is a Windows Form.

[quoted text, click to view]
AddThis Social Bookmark Button