Symbolic names for WPF system colors?

时间:2018-06-28 06:52:56

标签: wpf colors system-setting

Where can I get symbolic names for WPF "system" colors? I tried SystemColors but the names do not tell me much, for example I don't see an entry for disabled label text color.

And I am looking for something along such lines -- enabled button text color, enabled button background color, disabled button text color, and so on.

1 个答案:

答案 0 :(得分:0)

您可以使用x:Static:

访问系统颜色。
<TextBox Text="Looks like disabled text" Foreground="{x:Static SystemColors.GrayTextBrush}"/>

由于默认颜色和模板Control Styles and Templates在其中定义了很多颜色,因此总是要注意一下。

这里有SystemColors