Category / Section
How to enable or disable the specific tab at runtime in WinForms TabControlAdv?
1 min read
Enable or disable the specific tab at run time
User can enable or disable the specific tab page at run time. It can be achieved by TabEnabled property of tab page. The following code demonstrates the same.
C#
//Enable the specific tab page this.tabPageAdv2.TabEnabled = true; this.tabPageAdv3.TabEnabled = true; //Disable the specific tab page this.tabPageAdv2.TabEnabled = false; this.tabPageAdv3.TabEnabled = false;
VB
'Enable the specific tab page Me.tabPageAdv2.TabEnabled = True Me.tabPageAdv3.TabEnabled = True 'Disable the specific tab page Me.tabPageAdv2.TabEnabled = False Me.tabPageAdv3.TabEnabled = False
Screenshot
Figure: Tab pages disabled.
Figure: Tab pages enabled.
Samples: