panel clear everything

y_zyx picture y_zyx · May 11, 2011 · Viewed 53.7k times · Source

I would like to reset a panel to its initial state. For e.g., I set an image as background, I drew graphics on a part of the panel. I have to clear everything. How?

Answer

Ralph Calupas de Guzman picture Ralph Calupas de Guzman · Jan 20, 2013

You have to clear the panel first

panel1.Controls.Clear();

then call the initial form.

panel1.Controls.Add(orig_form);