How can I change the color of a disabled tab control

Go To StackoverFlow.com

0

I have my current program disabling a tabControl on startup until a button is pressed. However I don't like the way that the tab looks when it is grayed out.

I want it to look just the same but still have it disabled. Is there a way that I can do this?

2012-04-04 17:28
by Ian Lundberg
Pretty subjective without saying what you don't find ugly. Why don't you just wait with adding the tab so there's nothing objectionable to look at. Or put the controls on a panel and disable the panel instead of the tab. Or prevent the user from selecting the tab with the Selecting event - Hans Passant 2012-04-04 19:13


0

You'll need to draw the TabControl yourself to achieve this. Here's a tutorial on CodeProject.com. Unfortunately, it takes some time to achieve it but that's up to you of course.

Instead of drawing the TabControl yourself, maybe you could disable the controls on the TabPage instead?

2012-04-04 17:34
by Rhapsody


0

If you're using WPF, you can use templates to customize your disabled style. Please see:

http://msdn.microsoft.com/en-us/library/ms754137.aspx

Notice the visual states for disabled controls, etc.

2012-04-04 17:36
by KP.
Ads