So you want to have the second tab disabled until they check this checkbox?
Well, after fiddling around for a little bit (I'm rather new to Visual Basic so maybe this could be done better) I've found out that there is no 'obvious' enabled state of the tab. The intellisense doesn't pick it up and it's not in the properties panel but you can set it through using: TabPageName.Enabled = False set that when the form loads, the user can still click the tab but all the controls within that tab are disabled (I don't know how to disable the tab entirely sorry :/)
Private Sub checkbox_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles checkBox.CheckedChanged
If checkBox.Checked = True Then
TabPageName.Enabled = True
ElseIf checkBox.Checked = False Then
TabPageName.Enabled = False
So make sure you set the Enabled State of the TabPage to False and then use that code, edit it to your hearts delight to enable the page. Maybe someone else knows how to disable the tab altogether :) but here's my suggestion.
Although you have mention a way to disable tab controls in vb.net that wasn't working Don't know the reason I'm using VB.Net 2005 it doesn't have enabled property for tabpages. Therefore once you type as follows it will prompt an error message
Enabled is not a property of TabPage
So if you find another way to disable tab pages please post it
Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged If CheckBox1.Checked = True Then TabControl1.SelectedTab = TabPage2 End If End Sub
kimbula, I know this thread is a bit old but I wanted to propose another option. You could have the tab removed (made invisible) when the form loads, then add it back when the user checks the checkbox.