C1MainMenu 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 will automatically appear in the component tray. The C1CommandHolder stores all of the menu's commands as a single collection. Only one C1MainMenu control can be added to a form.
In the Visual Studio Toolbox, double-click on the C1MainMenu component or drag and drop it onto the form.
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Imports C1.Win.C1Command Dim ch As C1CommandHolder(Me) Dim mm As New C1MainMenu Me.Controls.Add(mm) |
To write code in C#
C# |
Copy Code
|
---|---|
using C1.Win.C1Command C1CommandHolder.CreateCommandHolder(this); C1MainMenu mm = new C1MainMenu(); this.Controls.Add(mm); |
The following screen shot depicts a C1MainMenu control once it’s been added to the form:
The C1MainMenu control includes a Link to Command designer that conveniently allows you to visually configure the menus.
For more information about the elements in the Link to Command designer see Link to Command Designer.
For more information that shows how to use the C1MainMenu control for specific tasks, see Menu Tasks.