Simple question…
I have controls that the user can drag around on my form at runtime. And they can also delete them… Should I just Call .Dispose(); when they click the delete button, or should I do something like panel1.Controls.Clear(Control); ? …Or something else?
Thanks 🙂
Bael
You should remove it from the parent Controls collection as described in Darin Dimitrov’s response, and also call Dispose:
You should always call Dispose on objects that implement IDisposable when you have finished with them, so that any unmanaged resources they own are immediately released.