Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check mark in a checkbox

Tags:

checkbox

wpf

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.

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?".

like image 379
Vadim Avatar asked Sep 20 '10 15:09

Vadim


People also ask

What is the shortcut key for checkmark?

Create a check mark symbol by pressing and holding Alt , and then typing 0252 using the numeric keypad on the right side of the keyboard.

Is there a check mark character?

U+2713 ✓ CHECK MARK.


1 Answers

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>
like image 190
Vadim Avatar answered Sep 23 '22 03:09

Vadim