Scrolling reset when application regains focus
-
Whenever my application loses focus, the scrolling of a panel is reset to the top position once focus is regained. This is really annoying. I have tried everything I can think of and researched to fix this such as overriding the scroll mechanism and saving coordinates; also doing the same during a mouse wheel scroll and trying to restore with the following method:
private void OnFormActivated(object sender, EventArgs e)
{
panel1.AutoScrollPosition = panelRect.Location; // panelRect is the location saved
} -
Whenever my application loses focus, the scrolling of a panel is reset to the top position once focus is regained. This is really annoying. I have tried everything I can think of and researched to fix this such as overriding the scroll mechanism and saving coordinates; also doing the same during a mouse wheel scroll and trying to restore with the following method:
private void OnFormActivated(object sender, EventArgs e)
{
panel1.AutoScrollPosition = panelRect.Location; // panelRect is the location saved
}This works for me: [^]. But, if your Panel is nested inside a Form, or other ContainerControl, with scrolling enabled/visible ... I don't know.
«Where is the Life we have lost in living? Where is the wisdom we have lost in knowledge? Where is the knowledge we have lost in information?» T. S. Elliot