Lasse V. Karlsen
Lasse V. Karlsen

Reputation: 391734

What is the system color of disabled text?

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.???;

Upvotes: 25

Views: 10419

Answers (4)

Adam Houldsworth
Adam Houldsworth

Reputation: 64557

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.

Upvotes: 21

Probably SystemColors.Control will give a color which is required by you or probably this

Upvotes: 0

Petar Petkov
Petar Petkov

Reputation: 1479

System.Drawing.SystemColors.GrayText should be it.

Upvotes: 4

Matt Hamilton
Matt Hamilton

Reputation: 204289

You're looking for SystemColors.GrayText.

Upvotes: 11

Related Questions