Objects added to panels and Dispose()

MatthewAmirault

New member
Joined
May 17, 2008
Messages
2
Programming Experience
1-3
In my application, I intend to have ~6 panels each having different objects in them (labels, textboxes, checkboxes, listboxes), only ever showing one at a time.

I would like to make a function for each panel which creates the panel, then create the objects, and adds them to the panel.

My question: If I later dispose of this panel (when I want to show a different panel), will all of the objects added to it be disposed as well? Or do I have to dispose of each object added to the panel, and then dispose the panel?

Thank you for your input.
 
Disposing a control will also dispose all child controls attached to it.
 
Back
Top