Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the color of inside circle of radio button in WPF XAML

This is my radio button:

<RadioButton Content="Add" Grid.Column="1" Height="16" HorizontalAlignment="Left" Margin="50,13,0,0" Name="rdAdd" VerticalAlignment="Top" GroupName="AddEditRadio" Checked ="rdAdd_Checked" FontSize="12.667" />

Now the color of inner circle of radio button is orange.I want to change it to blue.

Which property do I set to get "Blue" color?

like image 498
K T Avatar asked Nov 01 '25 13:11

K T


2 Answers

I'm afraid there is no direct property you can use to change the color.
What you need to do is reTemplate the RadioButton to whatever you would like.

Luckily, the default templates are available, here is the one for the RadioButton.

If I understand correctly what you want to change, you should probably modify the color of the CheckMark (or the entire BulletDecorator depends what you're trying to achieve).

like image 134
Blachshma Avatar answered Nov 03 '25 09:11

Blachshma


<RadioButton Content="Add" Background="Blue" Foreground="Green" BorderBrush="Red" BorderThickness="5" />

(i added BorderThickness of 5 to make it easier to see)

This will change the background color of the radio button to blue, the text "ADD" to green, and the border (around the button) red, like this:

radio button, selected and unselected

These are the only colors you can directly change from Radio button (without using templates and such)

like image 39
00jt Avatar answered Nov 03 '25 08:11

00jt



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!