复选框中的复选标记 [英] Check mark in a checkbox

查看:297
本文介绍了复选框中的复选标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我简单的WPF应用程序中,我使用常规的复选框控件。它看起来像我可以控制背景和前景。 Foreground属性控制复选框旁边的文本,但不控制复选标记。默认背景是白色,我的前景非常接近白色,因为我有一个黑暗的窗体背景。

In my simple WPF application I use regular CheckBox control. It looks like I can control background and foreground. Foreground property controls the text next to the check box but not the check mark. By default background is white, my foreground is very close to white because I have a dark windows form background.

当我在我的开发Windows 7机器上运行应用程序检查标记为黑色。在Win XP计算机上,复选标记为绿色。然而在另一台Win XP机器上,复选标记是不可见的,因为它是白色的。

When I run the application on my development Windows 7 machine the check mark is black. On Win XP computer the check mark is green. However on another Win XP machine the check mark is invisible because it's white on white.

我的问题是如何控制复选框的复选标记的颜色?。

My question is "How can I control the color of a check mark of my check box?".

推荐答案

这个问题发生在使用Windows Classic主题或使用远程桌面的Win XP上。
复选框的项目符号复选标记为整个CheckBox的前景颜色。

This issue happens on Win XP that uses'Windows Classic' theme or using Remote Desktop. Bullet check mark of a check box takes color of foreground color for the whole CheckBox.

<CheckBox Foreground="White" Content="My Text" />

我可以通过改成下面的代码来解决这个问题:

I was able to fix this problem by changing to the code below:

<CheckBox>
   <Label Foreground="White">My Text</Label>
</CheckBox>

这篇关于复选框中的复选标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆