TableLayoutPanel displays vertical scroll

前端 未结 5 909
有刺的猬
有刺的猬 2020-12-05 05:49

I have TableLayoutPanel for dynamic creation of controls with AutoScroll = true. It\'s work fine when I add new controls. But when I remove and all controls are visible, ver

5条回答
  •  醉酒成梦
    2020-12-05 06:23

    I counted the number of rows in my TableLayoutPanel to see how many would fit. Below the amount that fit I set AutoScroll = false for the add and delete methods. The scroll will appear for large sets and disappear on small sets.

    if (tableLayoutPanel.RowCount < 15)
    {
        panel1.AutoScroll = false;
    }
    else
    {
         panel1.AutoScroll = true;
    }
    

提交回复
热议问题