title: C# Adding textboxes when tabs are created
body: <p>I have a tab control on my form.  I prompt the user through user input (using the Visual Basic library) how many pockets does the header have.  The number in the textbox generates that many number of tabs.  </p>
  
  <p><strong>Question</strong></p>
  
  <p>How do I add textboxes when new tabs are generated?  Since the number is unknown until I tell it, it wouldn't make sense to just add textboxes to the designer for example.</p>
  
  <p><strong>What I have</strong></p>
  
  <pre><code> private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
          {
              string input = Microsoft.VisualBasic.Interaction.InputBox("How many pockets does the header have?", "Pocket Count", "",-1,-1);
              for (int i = 1; i &lt; Convert.ToInt32(input) + 1; i++)
              {
                  tabControl1.TabPages.Add("Pocket" + i);
                  TextBox txt = new TextBox();
                  txt.Name = tabControl1.Name;
  
  
              }
              tabControl1.TabPages.Add("Next");
          }
  </code></pre>