Articles in this section
Category / Section

How to hide TabPageAdv when TabPageAdvCollection count is reduced to one in WinForms TabControlAdv?

1 min read

Hide tab page in TabControlAdv

In TabControlAdv, when the TabPageAdvCollection count is reduced to one it can be hidden by handling its SelectedIndexChanged event and using TabVisible property in TabPageAdv.


private void tabControlAdv1_SelectedIndexChanged(object sender, EventArgs e)
   if(tabControlAdv1.TabCount == 1)
      tabControlAdv1.SelectedTab.TabVisible = false;
private void button1_Click(object sender, EventArgs e)
   tabControlAdv1.SelectedTab.TabVisible = true;
   TabPageAdv page = new TabPageAdv();
   page.Text = "NewTab";


Private Sub tabControlAdv1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles tabControlAdv1.SelectedIndexChanged
   If tabControlAdv1.TabCount = 1 Then
      tabControlAdv1.SelectedTab.TabVisible = False
   End If
End Sub
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles button1.Click
   tabControlAdv1.SelectedTab.TabVisible = True
   Dim page As New TabPageAdv()
   page.Text = "NewTab"
End Sub


Did you find this information helpful?
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment