Scroll position in WinForms

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.
 
N

Nicholas Paldino [.NET/C# MVP]

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.
 
T

Tim Warwick

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top