0

So i have several tabs, and i close them all using a button with:

TabControl1.Controls.Remove(TabControl1.SelectedTab)

But I have been trying to figure out how to make sure the main tab doesnt close.
What can i do to make sure the main tab can't shut down, when closing tabs with the above code?

Thanks in advance

-Doc

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by DoctorGiraffe
0

Just check that the selected tab page doesn't equal a tab page you don't want to remove.

I named a tab page - tbpgMain. This will ensure it can't be removed.

If Not TabControl1.SelectedTab.Equals(tbpgMain) Then
      TabControl1.Controls.Remove(TabControl1.SelectedTab)
 End If
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.