Relatively simple problem.
I have a panel with some textboxes on it, all dynamically created. The user fills in some of the textboxes and then proceeds to close the panel.
Now in the code I use the line;
Me.Pnl_Main.Controls.Clear()
and this works fine, the panel contents are "removed".
The problem is, is that when the textboxes are recreated for the same purpose, they still contain the values they had previously.
And unfortunately for me, most of the UI is created like this, which inevitably leads to a memory leak.
So my question is, is there a proper way to remove a control completly from memory? Or do I need to run a routine to set all text values to Nothing?
Thanks in advance.