Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does clicking in a text box cause an AutoScroll panel to scroll back to the top?

Finishing up a register form in a C# application and I noticed with the panel if I enable AutoScroll and then have a textbox that is below the scroll and click on it it jumps all the way back up to the top. Is there a way to fix this with some code or is it a propriety?

It's a little difficult for me to explain it in words, so here's a short video that shows the behavior.

like image 935
Sean Avatar asked Dec 05 '10 04:12

Sean


1 Answers

I have had the same problem. I fixed it with this code in my panel:

protected override Point ScrollToControl(Control activeControl)
{
    return this.AutoScrollPosition;
}
like image 186
Klaasvaak Avatar answered Sep 22 '22 13:09

Klaasvaak