panel clear everything
问题 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? 回答1: You have to clear the panel first panel1.Controls.Clear(); then call the initial form. panel1.Controls.Add(orig_form); 回答2: Use the following code to delete all graphics from the panel panel1.Invalidate(); If there is something you need to add to panel's initial state then after you call invalidate you again have to set those