Articles in this section
Category / Section

How to set custom style to Checkbox for WPF MenuAdv Control?

3 mins read

This article explains how to customize the CheckBox container’s style within a WPF MenuAdv control by applying a custom style to the CheckBox. These simple steps will demonstrate how to customize the appearance of the CheckBox within the MenuItemAdv in MenuAdv control.

Step 1: In your XAML resource section, define a custom CheckBox style and assign it a unique key, such as “CustomCheckBoxStyle.”

XAML

<window.resources>
   
</window.resources>

Step 2: Apply the custom CheckBox style to the CheckBoxes within the MenuItemAdv sections. Use the CheckBoxStyle property and refer to the defined custom style key.

XAML

<grid margin="20">
   <syncfusion:menuadv height="25" verticalalignment="Top" orientation="Vertical" width="120" horizontalalignment="Left" borderbrush="Black" borderthickness="1">
       <syncfusion:menuitemadv header="Products">
       <syncfusion:menuitemadv header="Business Intelligence">
       <syncfusion:menuitemadv header="User Interface">
           <syncfusion:menuitemadv header="WPF  ">
               <syncfusion:menuitemadv header="Tools" checkboxstyle="{StaticResource CustomCheckBoxStyle}" checkicontype="CheckBox" ischecked="True" ischeckable="True">
               <syncfusion:menuitemadv header="Chart" checkboxstyle="{StaticResource CheckBoxStyleKey}" checkicontype="CheckBox" ischecked="True" ischeckable="True">
               <syncfusion:menuitemadv header="Grid" checkboxstyle="{StaticResource CheckBoxStyleKey}" checkicontype="CheckBox" ischecked="True" ischeckable="True">
           </syncfusion:menuitemadv>
           <syncfusion:menuitemadv header="Silverlight ">
           <syncfusion:menuitemadv header="Reporting">
       </syncfusion:menuitemadv>
   </syncfusion:menuitemadv></syncfusion:menuitemadv></syncfusion:menuitemadv></syncfusion:menuitemadv></syncfusion:menuitemadv></syncfusion:menuitemadv></syncfusion:menuitemadv></syncfusion:menuadv>
</grid>

Output:

Default_style_for_CheckBox.png

Figure:1 Default style for CheckBox in MenuAdv control.

Custom_style_for_CheckBox.png

Figure:2 Custom style for CheckBox in MenuAdv control.

Conclusion

I hope you enjoyed learning how to set custom style to Checkbox for MenuAdv Control.

You can refer to our WPF Menu feature tour page to learn about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our WPF Menu example to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied