title: vb.net deleting a label and textbox at runtime
body: <p>So i have a class that creates a new label and textbox when it is called. The names of each label and textbox are in a continues order counting upward using a variable called <code>i</code>:</p>
  
  <ul>
  <li><code>"Label" &amp; i</code> creates the name Label1 and <code>"Textbox" &amp; i</code> creates the name Textbox1</li>
  <li><code>i += 1</code></li>
  </ul>
  
  <p>And so on. Now i want to add a procedure that deletes the last label and textbox using <code>i</code>. I have tried to make this procedure using the lines of code below but this doesnt work as the string cannot be converted to system.windows.forms.control : </p>
  
  <p><code>Form1.Controls.Remove("Label" &amp; i)
   Form1.Controls.Remove("Textbox" &amp; i)
   i -= 1</code></p>
  
  <p><code>Controls</code> is a list of controls using the line of code:
  <code>Public controls As List(Of Control)</code></p>
  
  <p>Basically i need a way to delete a label and textbox using the variable <code>i</code> in the class. Any ideas? Thanks.</p>