I have a panel on a form and at runtime I create some controls on the panel. Then, also during runtime I want to clear the panel of all of its controls. The basic way to do this is with the following code:
Expand|Select|Wrap|Line Numbers
- For Each this_ctrl As Object In target_panel.Controls
- this_ctrl.Dispose()
- Next
So I think this is strange. Can anyone suggest a cause for the problem, or another way of clearing the panel?
Thanks heaps,
Ash
PS: I'm using Visual Studio 2005