|
-
Dec 13th, 2022, 08:44 AM
#1
Thread Starter
Junior Member
[RESOLVED] Prevent AutoScroll from jumping to the top
I’ve got a custom control derived from System.Windows.Forms.UserControl, which paints itself in an overridden OnPaint proc and also has a varying number of other controls sitting on top. Depending on user input this custom control might grow larger than can be displayed in its parent form.
I set AutoScroll=True and VerticalScroll.Visible = True for the custom control to enable scrolling. This works as expected.
However, after any other window got the focus and then the focus is reset to my form with the custom control again, the control will automatically scroll to the very top of the scrollbar. – This is very annoying as users needs to reposition the scroll bar to where they were before.
How can I prevent AutoScroll from jumping to the top when the form gets the focus?
(PS: Target Framework is still .NET Framework 2.0.)
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|