# Creating Menus

## Content



Using Menu for WPF, you can create a menu with submenu and context menu. The following sections will guide you through the steps to create a complete menu.

### Creating a Top-Level Menu

1.  Add a **C1Menu** to your application.
2.  Place the following XAML between the **<c1:C1Menu>** and **</c1:C1Menu>** tags.

```xml
<c1:C1MenuItem Header="MenuItem1" Height="Auto" Width="Auto"/>
<c1:C1MenuItem Header="MenuItem2" Height="Auto" Width="Auto"/>
<c1:C1MenuItem Header="MenuItem3" Height="Auto" Width="Auto"/>
```

3.  Add **Height="Auto"** and **Width="Auto"** to the **<c1:C1Menu>** tag.
4.  Run the program and observe that a menu bar with three items appears.

### Creating a Submenu

In this topic, you will create a submenu that's attached to one of a menu's items. This topic assumes that you have [created a top-level menu](/componentone/docs/wpf/online-menu5/overview/flat-menu/CreatingMenus#creating-a-top-level-menu) with at least one menu item.

1.  Place the following XAML between the <c1:C1Menu> and </c1:C1Menu> tags.

```xml
<c1:C1MenuItem Header="Click here" Height="Auto" Width="Auto">
     <c1:C1MenuItem Header="Submenu Item" Height="Auto" Width="Auto"/>
     <c1:C1MenuItem Header="Submenu Item" Height="Auto" Width="Auto"/>
     <c1:C1MenuItem Header="Submenu Item" Height="Auto" Width="Auto"/>
</c1:C1MenuItem>
```

2.  Add Height="Auto" and Width="Auto" to the <c1:C1Menu> tag.

3.  Run the program and click the **Click here** menu item. Observe that a submenu with three items appears.