title: Put form components in tab at runtime
body: <p>I have a project with multiple windows forms, each of which is used to edit records of different database tables. Some of those database tables have a column named <code>mycolumn</code>, which has not been used by the implementation of the project, until now. </p>
  
  <p>For the database tables which have column <code>mycolumn</code>, I would like to add a tab control to the windows form that corresponds to the database table. I would like to do this programatically, at runtime. </p>
  
  <p>I have found some Stackoverflow answers that allow you to add a tab control (at runtime) to a form that already has one tab. Unfortunately, that doesn't work for me, because all forms do not have tabs yet. A call such as <code>tabControl.Controls.Add(tabpagename)</code> does not work, because I have no tabControls yet. </p>
  
  <p>Thus, I am looking for a way to programatically create a tab control and put all existing form components inside the first tab, such that I can use this to add tabs to the tab control programatically in the future.</p>
  
  <p>Pseudo code looks like:</p>
  
  <pre><code>    form1constructor() {
          InitializeComponent();
  
          if (TableHasColumn("mycolumn")) {
              PutAllExistingComponentsInTabControl(); // Don't know how to do this
              AddTabControlWithName("myColumn"); // DO know how to do this, not part of the question
  
      }
  </code></pre>
  
  <p>How do I do this?</p>