title: How to add new tabs to a TabControl and be able to update controls in them?
body: <p>I need to be able to programmatically create new tabs on a TabControl, add controls to them, and be able to update the controls in each tab from another function. I already have a function to add tabs to the control, and to add controls to those tabs when they are created, but I'm stuck as to update the controls after they have been created.</p>
  
  <p>EDIT: This is what I have to make the tabs and add the controls:</p>
  
  <pre><code>Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  
      Dim tabpage As New TabPage
      tabpage.Text = "(empty)"
  
      Dim textbox1 As New TextBox
      Dim textbox2 As New TextBox
  
      textbox1.Parent = tabpage
      textbox2.Parent = tabpage
  
      textbox1.Location = New Point(10, 10)
      textbox2.Location = New Point(10, 30)
  
      TabControl1.TabPages.Add(tabpage)
  
  End Sub
  </code></pre>
  
  <hr>
  
  <p>Urgh. I can't seem to get back into the account I used to post this question, so I have to post my follow-up to Tim's question in the comments for the previous answer as a new answer.
  <code>Debug.WriteLine(TabControl1.TabPages.Item(2).Controls.Find("textbox1", True).Count)</code> returns 0. The tab and the controls have been created prior. </p>