MenuItem

Represents an individual item that is displayed within a MainMenu or ContextMenu.

In order for a MenuItem to be displayed, you must add it to a MainMenu, MenuBar, or ContextMenu. To create submenus, you can add MenuItem objects to the MenuItems property of the parent MenuItem.

The MenuItem class provides properties that enable you to configure the appearance and functionality of a menu item. To display a check mark next to a menu item, use the Checked property. You can use this feature to identify a menu item that is selected in a list of mutually exclusive menu items. For example, if you have a set of menu items for setting the color of text in a TextBox control, you can use the Checked property to identify which color is currently selected. The Shortcut property can be used to define a keyboard combination that can be pressed to select the menu item.

For MenuItem objects displayed in a Multiple Document Interface (MDI) application, you can use the MergeMenu method to merge the menus of an MDI parent for with that of its child forms to create a consolidated menu structure. Because a MenuItem cannot be reused in multiple locations at the same time, such as in a MainMenu and a ContextMenu, you can use the CloneMenu method to create a copy of a MenuItem for use in another location.

The Popup event enables you to perform tasks before a menu is displayed. For example, you can create an event handler for this event to display or hide menu items based on the state of your code. The Select event enables you to perform tasks such as providing detailed help for your application's menu items when the user places the mouse pointer over a menu item.

For a full list of properties, methods and events see the API documentation.

Advanced

JavaScript Widget

ItemDescription

Class name

"wisej.web.menu.MenuItem"

Theme appearance

"item", see Themes.

Child components

"icon" is the item's icon, if applicable.

Source code

Last updated