Dynamic panel element adding and scrollbars

后端 未结 1 936
一个人的身影
一个人的身影 2020-12-19 02:34

I wrote a function to dynamically add elements to the \"Panel\".

public int State;        
public Point Point = new Point(0, 0);
public void DialogAdd(string         


        
1条回答
  •  离开以前
    2020-12-19 02:57

    When placing the controls inside the panel, you have to compensate for the scroll position:

    Basically, try using this line:

    d.Location = new Point(0, panel1.AutoScrollPosition.Y + Point.Y);
    

    0 讨论(0)
提交回复
热议问题