Click here to Skip to main content
15,910,980 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I use tabcontrol then I have two tabs I want is that if I go to the second tab I want that my toolbar will be disable I know how to disable my toolbar but the problem how to tell my program that if I am in the second tab the toolbar should be disable???


I use this codes....


If Me.TabControlDatabaseView.TabIndex Then
SupplierBindingNavigator.Visible = False
FillByFNameToolStrip.Visible = False
End If
TabControlDatabaseView.TabIndex = 1 <--- not working


If Me.TabControlDatabaseView.Top Then
SupplierBindingNavigator.Visible = False
FillByFNameToolStrip.Visible = False
End If
TabControlDatabaseView.TabIndex = 1 <--- not working
Posted

If I understand your problem correctly, I think you want something like this in your tab control's selected index changed event:

<pre lang="vb">

Private Sub myTabControl_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyTabControl.SelectedIndexChanged
If MyTabControl.SelectedTab Is myTabSecondTab Then
'Disable toolbar
Else
'Enable toolbar
End If

End Sub</pre>
 
Share this answer
 
Thank you very much .............................

I have added some code to the given code if I return to tab1 then it will show the toolbar again thank you very much more power to you...

If TabControlData.SelectedTab Is TabControlData Then
SupplierBindingNavigator.Visible = True
FillByFNameToolStrip.Visible = True
Else
SupplierBindingNavigator.Visible = False
FillByFNameToolStrip.Visible = False
End If

If TabControlData.SelectedTab Is TabPageSupplierInformation Then
SupplierBindingNavigator.Visible = True
End If
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900