禁用文本的系统颜色是什么? [英] 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.
问题是这样的:if我想选择正确的系统颜色,以便该控件具有与禁用的文本相同的颜色作为相邻的禁用标签,我应该选择哪个系统颜色?我尝试了几个,没有一个是正确的,他们有点太轻或太黑了。
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.
换句话说,假设ForeColor属性存在,我应该在这里写什么:
In other words, suppose the ForeColor property is present, what should I write here:
myDefunctLabel.ForeColor = SystemColors.???;
推荐答案
SystemColors.ControlDark
在我的屏幕上看起来不错。这是从实际尝试他们。
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.
但根据文档, GrayText
是一个你需要。请记住,我试过我的示例在Windows 7与Aero启用,不知道如果屏幕主题在这里着色与这里的着色。
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.
这篇关于禁用文本的系统颜色是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!