How to disable TabPage of TabControl
-
In my application there are 3 tab pages my problem is when i open my application 3rd tab pages should be open and other 1st and 2nd tab page should be disabled. if i click on enable tab pages then both 1st and 2nd tab page will be enable and 3rd tab page should be disable i have tried tabpage.hide property of tab page but it is not work
-
In my application there are 3 tab pages my problem is when i open my application 3rd tab pages should be open and other 1st and 2nd tab page should be disabled. if i click on enable tab pages then both 1st and 2nd tab page will be enable and 3rd tab page should be disable i have tried tabpage.hide property of tab page but it is not work
Check if this helps: http://msdn.microsoft.com/en-us/library/252t3cec.aspx[^]
"Legacy code" often differs from its suggested alternative by actually working and scaling. —Bjarne Stroustrup
-
In my application there are 3 tab pages my problem is when i open my application 3rd tab pages should be open and other 1st and 2nd tab page should be disabled. if i click on enable tab pages then both 1st and 2nd tab page will be enable and 3rd tab page should be disable i have tried tabpage.hide property of tab page but it is not work
A
TabControl
stores it's pages in a[TabPageCollection](http://msdn.microsoft.com/en-us/library/system.windows.forms.tabcontrol.tabpagecollection_methods.aspx)[[^](http://msdn.microsoft.com/en-us/library/system.windows.forms.tabcontrol.tabpagecollection_methods.aspx "New Window")]
. You can add or remove pages from this collection. Hope this helps :)I are troll :)
-
A
TabControl
stores it's pages in a[TabPageCollection](http://msdn.microsoft.com/en-us/library/system.windows.forms.tabcontrol.tabpagecollection_methods.aspx)[[^](http://msdn.microsoft.com/en-us/library/system.windows.forms.tabcontrol.tabpagecollection_methods.aspx "New Window")]
. You can add or remove pages from this collection. Hope this helps :)I are troll :)
my question is not about how to add or remove tab pages, but i want to enable - disable some tab page by programming
-
Check if this helps: http://msdn.microsoft.com/en-us/library/252t3cec.aspx[^]
"Legacy code" often differs from its suggested alternative by actually working and scaling. —Bjarne Stroustrup
Thanks for answer its too informatic and good
-
my question is not about how to add or remove tab pages, but i want to enable - disable some tab page by programming
-
I'm sorry for wasting your time, but at the time it sounded like a viable alternative to me :)
I are troll :)
Its Ok Dear As there is no any "Enabled" property of tab page so we have to check it is in tabcontrol's "SelectedIndexChanged" event like the following code Private Sub tabCon_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles tabCon.SelectedIndexChanged If YourCondition Then Me.tabCon.SelectedIndex = 1 End If End Sub to set defualt TabPage write the following code in form load event Me.tabCon.SelectedIndex = 1 'Here 1 is the index of desired tabpage