title: How do i get data from a textbox that is made during the runtime of the program?
body: <p>this is my code its the start of a customer details editing system for my course work</p>
  <pre><code>Public Class editCustomerFields
      Dim textbox As New TextBox
      Private Sub editCustomerFields_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  
          Dim updownLBL As Integer = 55
          Dim updownTXT As Integer = 80
          Dim leftRight As Integer = 30
          For i = 0 To globalVariables.countForCustomerDetails - 1
              Dim label As New Label
  
  
              label.Size = New System.Drawing.Size(159, 23)
              label.Location = New System.Drawing.Point(leftRight, updownLBL)
              label.Text = globalVariables.fieldsCustomerDetailsArray(globalVariables.editCustomerDetailsTxtNamesList.Item(i))
              label.Name = globalVariables.fieldsCustomerDetailsArray(globalVariables.editCustomerDetailsTxtNamesList.Item(i))
              Me.Controls.Add(label)
  
              TextBox.Size = New System.Drawing.Size(315, 30)
              TextBox.Location = New System.Drawing.Point(leftRight, updownTXT)
              textbox.Name = globalVariables.fieldsCustomerDetailsArray(globalVariables.editCustomerDetailsTxtNamesList.Item(i))
              MsgBox(TextBox.Name)
              Me.Controls.Add(textbox)
  
              globalVariables.txtEditCustomerDetailsArray(i) = textbox.Name
  
  
              updownLBL += 60
              updownTXT += 60
  
              If updownTXT &gt;= 500 Then
                  leftRight = 350
                  updownTXT = 80
                  updownLBL = 55
              End If
          Next
  
      End Sub
  End Class
  </code></pre>
  <p>i have a bunch of checkboxes that the user selects that correspond to the different fields in the database. then the program takes the input and on another form displays textboxes and labels for the user to enter data into. How do I get the data entered in the textbox?</p>
  <p><code>fieldsCustomerDetailsArray</code> is an array of the field names (&quot;username&quot;,&quot;password&quot; etc)</p>
  <p><code>editCustomerDetailsTxtNamesList</code> is a list of the checkboxes for the array to use</p>