# MainMenu Control

Get started with Menus and Toolbars for WinForms. Create versatile menus and docking/floating toolbars. See more in documentation here.

## Content



[C1MainMenu](/componentone/docs/win/online-menus-toolbar/) is a control that displays the main menu in a Windows form. When you place this object on your form, it will show across the whole form at the top, as regular Windows main menus do. In addition to the main menu at the top of the form, a [C1CommandHolder](/componentone/docs/win/online-menus-toolbar/) will automatically appear in the component tray. The [C1CommandHolder](/componentone/docs/win/online-menus-toolbar/) stores all of the menu's commands as a single collection. Only one [C1MainMenu](/componentone/docs/win/online-menus-toolbar/) control can be added to a form.

### To add the C1MainMenu control at design-time:

In the Visual Studio Toolbox, double-click on the [C1MainMenu](/componentone/docs/win/online-menus-toolbar/) component or drag and drop it onto the form.

### To add the C1MainMenu control programmatically:

DOC-DETAILS-TAG-OPEN

DOC-SUMMARY-TAG-OPEN

To write code in Visual Basic

DOC-SUMMARY-TAG-CLOSE

```vbnet
Imports C1.Win.C1Command
Dim ch As C1CommandHolder(Me)
Dim mm As New C1MainMenu
Me.Controls.Add(mm)
```

DOC-DETAILS-TAG-CLOSE

DOC-DETAILS-TAG-OPEN

DOC-SUMMARY-TAG-OPEN

To write code in C#

DOC-SUMMARY-TAG-CLOSE

```csharp
using C1.Win.C1Command
C1CommandHolder.CreateCommandHolder(this);
C1MainMenu mm = new C1MainMenu();
this.Controls.Add(mm);
```

DOC-DETAILS-TAG-CLOSE

The following screen shot depicts a [C1MainMenu](/componentone/docs/win/online-menus-toolbar/) control once it’s been added to the form:

![C1MainMenu control](https://cdn.mescius.io/document-site-files/images/a27cb622-e6d9-4efc-a0b0-0c31245fd632/c1mainmenuonform.png)

<br />

The [C1MainMenu](/componentone/docs/win/online-menus-toolbar/) control includes a **Link to Command** designer that conveniently allows you to visually configure the menus.


> type=note
> **Note**: This editor is available for all C1CommandLinks; therefore, you can easily edit all command links for any of the objects: C1ContextMenu, C1ToolBar, and C1OutBar.

For more information about the elements in the **Link to Command** designer see [Link to Command Designer](/componentone/docs/win/online-menus-toolbar/designtimesupport/linktocommanddesigne).

For more information that shows how to use the **C1MainMenu** control for specific tasks, see [Menu Tasks](/componentone/docs/win/online-menus-toolbar/menusandtoolbarsforw2/menutasks).

## See Also

[ToolBar Control](/componentone/docs/win/online-menus-toolbar/menusandtoolbarsover/uniqueobjectsamongme/c1toolbarcontrol)