WPF 复选框背景颜色在 Windows Vista 中不可见

发布于 2024-09-27 11:04:42 字数 114 浏览 7 评论 0原文

我已在 WPF 中将复选框控件的背景属性设置为颜色。 在 Windows XP 上运行时显示正常,但在 Vista 中显示为边框颜色。

有人知道这种行为的原因以及如何克服吗?

谢谢。

I have set the background property of a checkbox control to a color, in WPF.
It appears OK when run on windows XP but appear as a border color in Vista.

Anyone know the reason for this behavior and how to overcome?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

初雪 2024-10-04 11:04:42

Aero (Vista) 和 Luna (XP) 主题的默认 ControlTemplates 不同,并且使用不同的 TemplateBinding 来应用外部设置的属性(例如背景)。要强制以不同方式使用画笔,您需要覆盖默认样式并应用您自己的模板,可能是 Aero 或 Luna 版本的修改副本。

The default ControlTemplates for the Aero (Vista) and Luna (XP) themes are different and make different use of TemplateBinding to apply externally set properties like Background. To force your brushes to be used differently you'll need to override the default Style and apply your own Template, probably a modified copy of the Aero or Luna version.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文