I have a control that doesn't have Disabled/Enabled support for text, so I need to build that into it.
The question is simply this: If I want to pick the right system color so that this control has the same color of its disabled text as neighboring disabled labels, which system color should I pick? I've tried a few and none seem right, they're either a bit too light or a bit too dark.
In other words, suppose the ForeColor property is present, what should I write here:
myDefunctLabel.ForeColor = SystemColors.???;
The background color for a disabled input in chrome is rgb(235,235,228) if that helps .. In firefox the disabled input background-color is F0F0F0.
The disabled property sets or returns whether a text field is disabled, or not. A disabled element is unusable and un-clickable. Disabled elements are usually rendered in gray by default in browsers.
I think what you really want to do is enable the TextBox and set the ReadOnly property to true . It's a bit tricky to change the color of the text in a disabled TextBox . I think you'd probably have to subclass and override the OnPaint event. ReadOnly though should give you the same result as !
SystemColors.ControlDark
looks good on my screen. And this is from actually trying them. I tried most of the others and the shade is wrong.
But according to the docs, GrayText
is the one you need. Bear in mind I tried my sample on Windows 7 with Aero enabled, not sure if screen themes plays silly with the colouring here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With