gpt4 book ai didi

wpf - 禁用按钮的字体颜色

转载 作者:行者123 更新时间:2023-12-02 19:59:57 28 4
gpt4 key购买 nike

当按钮的 IsEnabled 属性为 false 时,如何找到字体的确切灰色?看来不同版本的 Windows 之间存在细微差别,因此我想从系统获取此颜色以确保 IsEnable 颜色匹配。

最佳答案

如果您查看此处的控件模板:

http://msdn.microsoft.com/en-us/library/ms753328.aspx

可以看到按钮禁用时的前景色定义如下:

<Color x:Key="DisabledForegroundColor">#FF888888</Color>

您应该能够从代码中查找DisabledForegroundColor (this.Resources["DisabledForegroundColor"])。

关于wpf - 禁用按钮的字体颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4770704/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com