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

Recommended Answers

All 2 Replies

You can't. You can delete it but not disable it.

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
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.