Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I disable a tab inside a TabControl?

Is there a way to disable a tab in a TabControl?

like image 543
Gold Avatar asked Jan 06 '09 20:01

Gold


People also ask

How to disable tabPage in tab Control in vb net?

TabPages(4). Enabled = False where the TabPages(4) is the 5th in the TabControl collection. Your initial code should work if that is your intent. Substitute your own values for "UnselectableTab" and "TabControlName" for your project.


1 Answers

Cast your TabPage to a Control, then set the Enabled property to false.

((Control)this.tabPage).Enabled = false; 

Therefore, the tabpage's header will still be enabled but its contents will be disabled.

like image 87
Cédric Guillemette Avatar answered Sep 18 '22 13:09

Cédric Guillemette