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.

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