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

前端 未结 4 1417
面向向阳花
面向向阳花 2021-01-02 17:14

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 jump

4条回答
  •  失恋的感觉
    2021-01-02 17:52

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

    protected override Point ScrollToControl(Control activeControl)
    {
        return this.AutoScrollPosition;
    }
    

提交回复
热议问题