I create a flow layout panel, each element of which represents a room. I want to reboot the entire room by deleting all the controls in the panel and adding new controls.
I used:
foreach(Control control in flowLayoutPanel.Controls) { flowLayoutPanel.Controls.Remove(control); control.Dispose(); }
but some controls cannot be deleted.
I tried to find a solution on the Internet, but did not find it anywhere.
Did any body help?
source share