We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Syncfusion site will be temporarily unavailable for scheduled maintenance on December 14, 2024, from 10:30 PM ET to 11:30 PM ET.
close icon

MenuItemAdv - How to change RadioButtonStyle?

How can I change the appearence of a Radio Button?

I tried this but this doesnt work:


<Setter Property="RadioButtonStyle">
     <Setter.Value>
         <RadioButton Background="Red" Foreground="Green"/>
     </Setter.Value>
</Setter>

1 Reply 1 reply marked as answer

KA Karthick Arjunan Syncfusion Team April 19, 2023 11:29 AM UTC

Hi Leon,

To set the style of a radio button in WPF, you can define a custom style that targets the RadioButton control. We have added the code snippet in which, we define a style called "RadioButtonStyle" that sets some basic properties such as Foreground, Background, and Margin. Also, we have attached the sample project for your reference. Please check the sample and let us know your concern.


Code Snippet:

<Style x:Key="RadioButtonStyle" TargetType="{x:Type RadioButton}">

    <Setter Property="Foreground" Value="Green"/>

    <Setter Property="Background" Value="Red"/>

    <Setter Property="Margin" Value="5"/>

</Style>



Regards

Karthick Arjunan


Attachment: MenuItemAdvDemo_ab6aa68e.zip

Marked as answer
Loader.
Up arrow icon