24 Dec

Solution: Changing color of disabled checkbox or radioButton

Applies to: C#.NET/VB.NET (Windows Programming).

1. Making it gray

After being disabled, the checkbox and radiobutton control’s ForeColor turns contrast to the BackColor of the form.
This behavior is good because it increases the readability of your forms.

But in some cases this is really not desired.

So in that case you can make the CheckBox/RadioButton gray by setting its

BackColor = Color.Transparent
This will give you desired output.

2. Changing the ForeColor

Sorry I do not have anything to offer you on the front.

There is a private property to the control class which seems to be deciding the disable backcolor of the Checkbox/radioButton.

If anyone has any idea about this let me know.



If you found this post helpful then please share it.


TweetIt from HubSpot

6 Responses to “Solution: Changing color of disabled checkbox or radioButton”

  1. 1
    fred Says:

    This is exactly what i have been looking for thank you

  2. 2
    Keith Says:

    Thank you, just what I needed

  3. 3
    Charlie Says:

    Sweet – cheers Jayvardhan

  4. 4
    BobD Says:

    Founds lots of hits when searching for this, but your suggestion is the only one that worked. Thanks!

  5. 5
    Arian Says:

    Hello there,

    The best thing that comes to my mind is place a checkbox without text and next to it a label with the text that should go in the checkbox. By doing that you can set the checkbox.enabled=false regardless the color of the label.

    yes it’s a little trick but it works ;)

  6. 6
    joe Says:

    The problem with Arian’s solution is that clicking on the textbox control is not counted as clicking the checkbox/radio button so at best, extra events must be created to relay each click event from the textbox to it’s checkbox control.

    This hack works well though, effortless.

Leave a Reply