I have one main Panel on a form that displays labels, textbox's, picturebox and a tablelayoutpanel (tablelayoutpanel contains: labels, textbox's and checkbox). When the user clicks a button on the Panel, I want to place a copy of the Panel into my TabControl without loosing controls from the original Panel. If they click the button five times I should have five independent working Panels in my Tabcontrol.
I have some code that partially works, but it zaps the controls off of my original Panel. Thank youf for you assistance
Dim ctrl As Control
For Each ctrl In Me.PDF_Panel.Controls
If Not IsNothing(ctrl) Then
Dim tmpCtrl As New Control
tmpCtrl = ctrl
My_New_Tab_Panel(BOM_TabControl1.TabPages.Count + 1 - 2).Controls.Add(tmpCtrl)