title: how to add controls dynamically to table layout panel from panel
body: <p>I have placed all the controls in one panel.During the run time i would like to add the control to table layout panel. To do that i have written following code.</p>
  
  <pre><code> void arrangeTableLayout()
      {
          int rowcount = 1;           
              tblPanel.ColumnCount=2;           
              tblPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
              tblPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
              for (int i = 0; i &lt; panel.Controls.Count; i++)
              {
                  if (panel.Controls[i].Visible)
                  {
  
                    tblPanel.Controls.Add(panel.Controls[i], 0, rowcount);
                    tblPanel.Controls.Add(panel.Controls[i + 1], 1, rowcount);
                    tblPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 40F));                            
                     i++;                           
                     rowcount++;
                   }                    
              }            
      } 
  </code></pre>
  
  <p>in the control array the controls are there as required to me. But the above code adding only labels in one column.</p>
  
  <p>Can any one tell me how to add the windows form controls dynamically to the table layout panel.</p>