Hello,everyone! I've knowan how to click treenode to make tabpages selected and show, but I don't want users could click the tabpage and selected one of them. I searched in internet and found that it should use a intenger such as "tab = 1" in some Tabcontrol and Tabpage events like this webpage said whick use TabPage1_Validating & TabPage1_Enter like below :
Private Sub TabPage1_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles TabPage1.Validating
If tab = 1 Then
e.Cancel = True
Else
e.Cancel = False
End If
End Sub
Private Sub TabPage1_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TabPage1.Enter
tab = 1 ' setting the selected tab when user gets back to this tab
End Sub
I tried it and now the tabpage could not click,but when I clicked treenode, it could not selected tabpage too.In fact,I didn't understand how the code in the webpage made tabpage disable click after I looked up in MSDN... X| Could anyone give me some suggestions and help? Thanks a lot!