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


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


Member Avatar for Unhnd_Exception

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
 End If
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.