MainMenu
The Wisej.NET MainMenu control contains a form's menu structure. It consists of MenuItem objects representing individual menu commands or submenus. Bind the MainMenu to a form by assigning it to the form's Menu property.
For multilingual support, use the RightToLeft property to display menu text appropriately for languages like Arabic.
Create different MainMenu objects for varied menu structures. Use CloneMenu to create reusable copies that can be modified for new menu structures.
For a full list of properties, methods and events see the API documentation.
Features
Auto Overflow
The AutoOverflow property automatically displays an overflow icon when menu items exceed available space.
-e26a7f9b05e1e20336af79e820cbb3ba.png)
Link Menu Items
LinkMenuItem objects provide URL-opening menu items.
-345d3304b673c2e4621bb448859c6d19.png)
Shortcuts
Shortcut keys enable quick access to frequent menu items and keyboard navigation for users without pointer devices.
-d1ea2e44227314ced3044e2b3269b597.png)
How To
Add Items
Add menu items in the designer by:
- Drag
MainMenufrom Toolbox to Form - Expand
MenuItemsproperty to add members
For programmatic menu item addition:
- C#
public void CreateMenu()
{
// Create an empty MainMenu.
MainMenu mainMenu1 = new MainMenu();
MenuItem menuItem1 = new MenuItem();
MenuItem menuItem2 = new MenuItem();
menuItem1.Text = "File";
menuItem2.Text = "Edit";
// Add two MenuItem objects to the MainMenu.
mainMenu1.MenuItems.Add(menuItem1);
mainMenu1.MenuItems.Add(menuItem2);
// Bind the MainMenu to Form1.
this.Menu = mainMenu1;
}
Advanced
JavaScript Widget
| Item | Description |
|---|---|
| Class name | "wisej.web.menu.MainMenu" |
| Theme appearance | "mainmenu", inherits from "menubar", see Themes |
| Source code | https://github.com/iceteagroup/wisej-js |