views:

29

answers:

1

Hi,

I am facing a problem with a Winforms app. If I scroll down and then minimize the app and then maximize it, navigation goes to the top of the page. I need to fix this so that people using this app dont have to find where they were before minimizing the app.

Any help or thoughts would be great.

+1  A: 

You're not really giving enough information but assuming that you've got a Panel (or another control that inherits from ScrollableControl) on your form that contains all the other controls and that is the control that the user has scrolled in you could probably do the following:

Handle the Resize event and store panel1.HorizontalScroll.Value somewhere when it's minimized and when it's maximized the Resize event will be called again and you could then set panel1.HorizontalScroll.Value to the stored value.

Handling the Resize event isn't a perfect way to catch minimize and maximize but it would probably work well enough since otherwise it would get a bit more difficult.

ho1