Scroll position in WinForms

  • Thread starter Thread starter Leonid Shirmanov
  • Start date Start date
L

Leonid Shirmanov

Hi,

I have a form with control placed on it. Control has the image painted on
its graphics.
Size of the contol is greater than size of the form and scroll bars appear
in the form.
I scroll the image to the end (i.e. bottom-right edge). After this, I open
other form
as modal dialog and after closing this modal form control with image
scrolled to
the beginning (i.e. top-left edge).
How can I leave scroll position unchangeable?

Thanks for your help.


Leonid.
 
Leonid,

This almost sounds like a bug. What I would do is note the location of
the view window (what you can see in the form) and then set it back when the
modal form is closed down.

Hope this helps.
 
If its of any relevance I remember the MS Java AWT ScrollPane did the
same thing. Somtimes leading to mismatches between the contents and the
scroll position.

It also had a similar problem with caret position in TextFields, come
back and the box has assumed the caret position is always at the
beginning meaning half the box is grey and half has the back end of the
text.

Is this an indication that MSJVM code is in the .NET framework? Or is it
a common bug?
 
Back
Top