How to properly remove a control from memory, in VB.Net? : <p>Relatively simple problem.</p>

<p>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.</p>

<p>Now in the code I use the line;</p>

<pre><code>Me.Pnl_Main.Controls.Clear()
</code></pre>

<p>and this works fine, the panel contents are "removed".</p>

<p>The problem is, is that when the textboxes are recreated for the same purpose, they still contain the values they had previously.</p>

<p>And unfortunately for me, most of the UI is created like this, which inevitably leads to a memory leak.</p>

<p>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?</p>

<p>Thanks in advance.</p>
