[ACCEPTED]-submenu items in WPF Menu-menuitem

Accepted answer
Score: 17

For submenus you can add as many MenuItem 1 nested inside.

  <MenuItem Header="File">
     <MenuItem Header="Open"/>
     <MenuItem Header="Close"/>
  <MenuItem Header="Edit">
     <MenuItem Header="Copy"/>
     <MenuItem Header="Paste"/>
  <MenuItem Header="Options"/>
Score: 4

Just redefine the ItemsPanel:

      <StackPanel Orientation="Vertical"/>
  <MenuItem Header="Foo"/>
  <MenuItem Header="Bar"/>
  <MenuItem Header="Baz"/>

Note that this will not 4 get rid of the vertical gradient effect 3 in Vista/Win7 menus. If you want that, set 2 Menu.Background property to whatever you want (could even 1 be Transparent).

More Related questions