Resource

How to add a Separator to a Menu in WPF

Soft Dev Resources Jun 19, 2009
We can add sub menus and sub menu items using the MenuItem tag within parent a MenuItem tag.
  • 0
  • 0
  • 23504

A separate is used to separate categories of menu items. We can add a separator to a menu control by using <Separator /> tag. 

We can also ass sub menus and sub menu items using the MenuItem tag within parent a MenuItem tag. The following code adds a separator and sub menus and sub menu items to the menu.

<Separator/>

<MenuItem Header="Sub Items">

    <MenuItem Header="Child1 SubItem" IsCheckable="true"/>

    <MenuItem Header="Child2 SubItem" IsCheckable="true">

        <MenuItem Header="GrandChild2 SubItem" IsCheckable="true"/>

     </MenuItem>

</MenuItem>

 

COMMENT USING

PREMIUM SPONSORS

Hire Mobile & Web Developer on demand. 100% satisfaction. Try for 1 week or Money Back. Local and remote developers available all over USA.

TOP RESOURCES

MOST LIKED RESOURCES