I figured it out, I'll psot the code soon.
I'm adding comment atm.
Code:'show tab Dim txt As Object Dim tabp As TabPage 'loop through all tabs in For Each tabp In TabControl2.TabPages 'loop through all objects in the tab For Each txt In tabp.Controls 'check if it's a label If TypeOf txt Is Label Then 'if it's a label, see what the text is If txt.text = "Autozone" Then 'if it's that text, move it to the first tabcontrol 'it'll be removed from the second tab TabControl1.TabPages.Add(tabp) End If End If Next NextThis code works fineCode:'hide tab Dim txt As Object Dim tabp As TabPage 'loop through first control For Each tabp In TabControl1.TabPages For Each txt In tabp.Controls If TypeOf txt Is Label Then If txt.text = "Autozone" Then 'add to second TabControl2.TabPages.Add(tabp) End If End If Next Next![]()




Reply With Quote