Remove all controls in a flowlayoutpanel in C#

前端 未结 4 1260
名媛妹妹
名媛妹妹 2021-02-10 01:45

I\'m building a flow layout panel whose each control represents for a room. I want to reload all room by removing all controls in the panel and adding new controls.

I us

4条回答
  •  余生分开走
    2021-02-10 02:11

    If you are looking for an easy and quick solution. Here it is.

    while (flowLayoutPanel.Controls.Count > 0) flowLayoutPanel.Controls.RemoveAt(0);
    

提交回复
热议问题