title: Moving controls among tabpages
body: <p>I'm trying to move 3 controls among 3 tabpages when the user is selecting a different tabpage. They're a toolsrtip control, a richtextbox control and a combobox control. </p>
  
  <p>The richtextbox and combobox will be assigned new values for some of their properties depending on the tabpage selected, the toolstrip should be the same, but it's methods (it's a typical font style handling toolstrip) should be affecting the richtextbox that is visible on the current tabpage only. </p>
  
  <p>Now, because changing the display value of a combobox also means that the richtextbox on the current tabpage will be assinged a new value for its text property, I didn't want to create like 3 comboboxes and 50 richtextboxes for every occasion. I want to create only one set of them and hold their values in some type of string collection before the uses raises an event, that is either change the combobox displayed item or changing the tabpage.</p>
  
  <p>Not having done this before I read this
  <a href="http://www.vbforums.com/showthread.php?478602-2005-Move-controls-From-One-Tab-Page-To-Another" rel="nofollow noreferrer">http://www.vbforums.com/showthread.php?478602-2005-Move-controls-From-One-Tab-Page-To-Another</a> which suggest to create a control for its occasion, which seems absurd to me...</p>
  
  <p>My current situation is that I have the controls displaying at tabpage1 through designer and then I tried something like this</p>
  
  <pre><code>Private Sub TabPage_Enter(sender As Object, e As EventArgs) Handles TabPage1.Enter, TabPage2.Enter, TabPage3.Enter
      Select Case DirectCast(sender, TabPage).Name
  
          Case "Tabpage1"
              TabPage1.Controls.Add(RichTextBox1)
              TabPage1.Controls.Add(ToolStrip1)
              TabPage1.Controls.Add(ComboBox1)
  
          Case "TabPage2"
              TabPage2.Controls.Add(RichTextBox1)
              TabPage2.Controls.Add(ToolStrip1)
              TabPage2.Controls.Add(ComboBox1)
  
          Case "TabPage3"
              TabPage3.Controls.Add(RichTextBox1)
              TabPage3.Controls.Add(ToolStrip1)
              TabPage3.Controls.Add(ComboBox1)
  
      End Select
  End Sub
  </code></pre>
  
  <p>Now when changing tabs, controls appear on tabpage2 and tabpage3 but tabpage1 remains empty. I tried doing this at form load event</p>
  
  <pre><code>TabPage1.Controls.Add(RichTextBox1)
  TabPage1.Controls.Add(ToolStrip1)
  TabPage1.Controls.Add(ComboBox1)
  </code></pre>
  
  <p>but still tabpage1 remains empty when changing back to its view. I'm not sure what I'm trying is what I want to do, but I understand that for this approach I shouldn't use designer at all and instead create the controls only in code handling size and location myself. Please advice if there is a "right" way of doing this, mainly for keeping the code short and tidy. TIA.</p>
  
  <p>ps.As I was writing this I realized that I could create only three of each control in designer for every tabpage and then handle the combobox change with the string collection way I had in mind. Seems sensible enough but I still wanna know about this, hence I'm still asking this question.</p>