Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 138
  • Last Modified:

How to set a specific tab to visable = false or enabled = false in vb.net 2005

Hi,

I have a tab control and a checkbox. The tab control has 2 tabs. I would like to know if I check the checkbox how to disable the second tab or set visible to false for the second tab please.

Many Thanks
Lee
0
ljhodgett
Asked:
ljhodgett
1 Solution
 
Wayne Taylor (webtubbs)Commented:
Hello Lee,

You can't make it invisible, but you can remove it, and save it in a variable so you can add it back later....

    Private MyTabControlPage As TabPage

    Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
        If MyTabControlPage Is Nothing Then MyTabControlPage = TabControl1.TabPages(1)
        If CheckBox1.Checked Then
            Me.TabControl1.TabPages.Remove(MyTabControlPage)
        Else
            Me.TabControl1.TabPages.Add(MyTabControlPage)
        End If
    End Sub

Regards,

Wayne
0
 
Éric MoreauSenior .Net ConsultantCommented:
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now