Winform problem with autoscrolling of the ScrollableControl

Posted by BobLim on Stack Overflow See other posts from Stack Overflow or by BobLim
Published on 2010-06-14T06:58:20Z Indexed on 2010/06/14 7:02 UTC
Read the original article Hit count: 676

Filed under:
|

Hi guys,

I have a problem with autoscrolling of the .NET ScrollableControl. I am using TabPage which inherited from ScrollableControl in the class hierarachy. Every TabPage object has only 1 UserControl derived control which draws the landscape; there is no other control on the tabpage.

The usage of my application is its user will drag a file from windows explorer and drop into the TabPage. As more files are dragged and dropped, the UserControl derived control will expand to accomodate the drawing of the files and auto-scrolling will be enabled.

The problem I have is when I mouse-click on the UserControl control, the vertical and horizontal scrollbars will scroll back to (0,0) position. I want the vertical and horizontal scrollbars to remain at their original scrolled position whatever happens. I believe when I mouse-click on the UserControl control, the UserControl control comes into focus and that triggers the auto-scrolling to (0,0) position.

Please help.

Thanks in advance!

© Stack Overflow or respective owner

Related posts about .NET

Related posts about winforms