views:

546

answers:

4

On a checkbox I can set .Enabled = False to gray-out the checkbox rectangle and associated label. But the appearance is not visually appealing, i.e. both the label and checkmark become "faint"; (I know i can use my own label but that's only half the solution).

If i set .AutoCheck = False, the colors remain normal, however user gets no clue that this checkbox is readonly.

Want i want is some way to explicitly control the background color of the rectangle, and the color of the checkmark that goes into it.

Is that too much to ask? (Think textbox, i can gray out the background, and the text can still be any color i want !)

+2  A: 

You might want to build your own checkbox to get this kind of control over it. However, I would carefully consider whether or not this is really the right thing to do. The checkbox behavior in Windows is well understood. By changing it, you may only serve to confuse your users.

Jon B
Not trying to change the underlying behaviour in any way, just the colors. In any case, that's my usual approach, stick to a standard... <sarcasm>until WPF came along...</sarcasm>.
joedotnot
A: 

The simplest solution for you would probably be to put a label with no text behind the checkbox. You can set the color of the label to whatever you want and also use the AutoCheck property on the CheckBox.

Eric
A: 

By changing the look of an disabled checkbox, you confuse the end user.

The power of an good GUI is offering an consistent style, so users recognize the fact a checkbox is disabled in an instant. Also note that when you're testing an control with custom controllers on XP, it can look way different on Vista, and even become glitched and unusable.

My advise is not to try to force an change of look, but try to let the application fit more smoothly into the OS.

Dykam
A: 

Going by the lack of "acceptable" answers to my initial question - how to explicitly control the background color of the rectangle, and the color of the checkmark that goes into it - i will park this question in the too hard basket :-) And write my own control when i get around to it.

joedotnot