0

hi friends,
i am having a Form in which there r 5 tab pages...
however i want to enable/disable these tab pages on the basis of selection of some commands..
how can this be done ?
i tried but i am not finding any enabled /disable property for the tab pages.

for ur understanding : my frame name is TABCONTROL1
and tab page name is : tabpage1
i want to enable/disable this page...how can it be done...

wating for quick response...

cya
Rohan

3
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by Teme64
0

You can't enable/disable tab pages in any simple way. There are some workarounds you could try.

Remove tab page:

TabControl1.TabPages.RemoveByKey("TabPage1")

If you need to "enable" it later, save it first:

Dim MyTabPage As TabPage
MyTabPage = TabControl1.TabPages.Item("TabPage1")
TabControl1.TabPages.RemoveByKey("TabPage1")

however, I didn't test this if it works.

Disable controls in the tab page:

Dim oc As Control
For Each oc In TabControl1.TabPages.Item("TabPage1").Controls
   oc.Enabled = False
Next
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.