UserControl Autoscroll - Uncontrollable Scrolling.

  • Thread starter Thread starter brian
  • Start date Start date
B

brian

The usercontrol has autoscroll set to true. Every once in
a while the usercontrol will automatically scroll to the
top on its own. The only visible event that I can see
fire is the Paint event. I have not been able to
determine the pattern of events that cause this, but most
the time it occurs when hiding other controls that are
docked with it.

Has anyone seen this issue, and have a solution to stop
it? Thanks.
 
Do you have other controls upon the user control? I believe this occurs
when a control upon the usercontrol receives the focus, and the usercontrol
is scrolled to display the control with the focus.

You may get this behaviour with a picturebox (for example) auto resized on a
usercontrol that scrolls to display the complete picturebox.

I think I handled this by overriding the WndProc and intercepting the
WM_FOCUS message.

HTH

Paul Wardle
 
That was the problem...thank you.
-----Original Message-----
Do you have other controls upon the user control? I believe this occurs
when a control upon the usercontrol receives the focus, and the usercontrol
is scrolled to display the control with the focus.

You may get this behaviour with a picturebox (for example) auto resized on a
usercontrol that scrolls to display the complete picturebox.

I think I handled this by overriding the WndProc and intercepting the
WM_FOCUS message.

HTH

Paul Wardle





.
 
Back
Top