【发布时间】:2019-07-18 19:46:46
【问题描述】:
有没有办法从后面的 WPF 代码中的 System.Windows.SystemColors.WindowTextBrushKey 中获取红色、黑色等颜色名称?
string color = "Black";
if (System.Windows.SystemParameters.HighContrast)
{
color = System.Windows.SystemColors.WindowTextBrushKey; // I want to get color from this value
}
【问题讨论】:
-
SystemColors.WindowTextBrush.Color.ToString()将返回"#FF000000"。也许这就足够了。 -
这将为您提供名称:stackoverflow.com/a/24468848/1136211
标签: c# wpf systemcolors high-contrast