Neutralize click event on Tab
-
I don't want users can choose any tab when they click on tabheader.How to do this?Please help me!!!!
Here is a C# code that would do a similar thing. Changing it to VB should not be a big task IMO.
bool CanSelect = false;
void tabControl1_Selecting(object sender, TabControlCancelEventArgs e) {
e.Cancel = !CanSelect;
CanSelect = true;
}Now, set the CanSelect variable to true when you want the selection to happen.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
-
Here is a C# code that would do a similar thing. Changing it to VB should not be a big task IMO.
bool CanSelect = false;
void tabControl1_Selecting(object sender, TabControlCancelEventArgs e) {
e.Cancel = !CanSelect;
CanSelect = true;
}Now, set the CanSelect variable to true when you want the selection to happen.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
The VB.Net for d@nish's code might be something like:
Private Sub TabControl1_Selecting(ByVal sender As Object, ByVal e As System.Windows.Forms.TabControlCancelEventArgs) Handles TabControl1.Selecting
e.Cancel = Not CanSelect
End Subi.e. If CanSelect is True then .......... Don't cancel the TabControl1_Selecting event If CanSelect is False then ......... Do cancel the TabControl1_Selecting event