title: vb.net add data from textboxes to array
body: <p>I have an assignment to create a program that basically grades a multiple choice test. I have a form with 20 textboxes to accept input (only the letters "a", "b", "c", or "d"), an array with the correct answers, and I created an array to hold all the text boxes:</p>
  
  <pre><code>dim txtboxes() as TextBox = {txtInput1, txtInput2...txtInput20}
  </code></pre>
  
  <p>I know there's got to be a way to use For Each where the type of control = textbox to iterate over all the textboxes, but I am kind of stuck on actually extracting the values from the textboxes and adding them to an array of their own. I've gotten as far as:</p>
  
  <pre><code>dim txtbox as TextBox
  for each txtbox in Controls.OfType(Of TextBox)
  </code></pre>
  
  <p>which isn't very far at all...</p>