this works in vb2005
vb Code:
TabControl1.TabPages.Add("your text") TabControl1.TabPages(TabControl1.TabPages.Count - 1).Show() For Each ctrl As Control In TabControl1.TabPages(1).Controls Dim newCtrl As Control = Nothing If TypeOf ctrl Is Label Then newCtrl = New Label ElseIf TypeOf ctrl Is TextBox Then newCtrl = New TextBox ElseIf TypeOf ctrl Is Button Then newCtrl = New Button End If newCtrl.Top = ctrl.Top newCtrl.Left = ctrl.Left newCtrl.Text = ctrl.Text TabControl1.TabPages(TabControl1.TabPages.Count - 1).Controls.Add(newCtrl) Next




Reply With Quote