Tab Control - Disabling a TabPage
-
Hi, I have a TabControl with 4 TabPages. Based on Access Permissions I want to grey out the selection of a particular TabPage. I used following property to disbale:- tabControlDeal.TabPages[3].Enabled = false But this disables all the controls on TabPages[3], but doesn't greyout TabPage selection. Is there any way out to greyout TabPage selection. Thanks in advance Ruchi
-
Hi, I have a TabControl with 4 TabPages. Based on Access Permissions I want to grey out the selection of a particular TabPage. I used following property to disbale:- tabControlDeal.TabPages[3].Enabled = false But this disables all the controls on TabPages[3], but doesn't greyout TabPage selection. Is there any way out to greyout TabPage selection. Thanks in advance Ruchi
You could owner-draw the tabs and set the text color to
SystemColors.GrayText
based on theTabPage.Enabled
property. Then, just make sure to reset the focus in case someone clicks on the tab. It's simplistic, but there's not a whole lot you can do with theTabControl
provided in the .NET FCL (mostly because there's not a lot you can do with the tab common control it encapsulates).Microsoft MVP, Visual C# My Articles