Skip to main content
Version: 4.1

MenuItem

Namespace: Wisej.Web

Assembly: Wisej.Framework (4.1.0.0)

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

public class MenuItem : Menu, ICommandSource

Constructors

Initializes a MenuItem with a blank caption.

Initializes a new instance of the MenuItem class with a specified caption for the menu item.

NameTypeDescription
textStringThe caption for the menu item.

Initializes a new instance of the class with a specified caption and event handler for the Click event of the menu item.

NameTypeDescription
textStringThe caption for the menu item.
onClickEventHandlerThe EventHandler that handles the Click event for this menu item.

Initializes a new instance of the class with a specified caption, event handler, and associated shortcut key for the menu item.

NameTypeDescription
textStringThe caption for the menu item.
onClickEventHandlerThe EventHandler that handles the Click event for this menu item.
shortcutShortcutOne of the Shortcut values.

Initializes a new instance of the class with a specified caption and an array of submenu items defined for the menu item.

NameTypeDescription
textStringThe caption for the menu item.
itemsMenuItem[]An array of MenuItem objects that contains the submenu items for this menu item.

Initializes a new instance of the MenuItem class with a specified caption; defined event-handlers for the Click, Select and Popup events; a shortcut key; a merge type; and order specified for the menu item.

NameTypeDescription
mergeTypeMenuMergeOne of the MenuMerge values.
mergeOrderInt32The relative position that this menu item will take in a merged menu.
shortcutShortcutOne of the Shortcut values.
textStringThe caption for the menu item.
onClickEventHandlerThe EventHandler that handles the Click event for this menu item.
onPopupEventHandlerThe EventHandler that handles the Popup event for this menu item.
onSelectEventHandlerThe EventHandler that handles the Select event for this menu item.
itemsMenuItem[]An array of MenuItem objects that contains the submenu items for this menu item.

Properties

Instance member AllowHtml

Boolean: Returns or sets a value indicating that the control can display HTML in the Text property. (Default: False)

Instance member AutoShowLoader

Boolean: Returns or sets whether the application blocks the browser with a modal mask when this menu item is clicked and until the server is done processing the execution request. (Default: False)

Instance member BackColor

Color: Returns or sets the background color of the menu item.

Instance member CharacterCasing

CharacterCasing: Returns or sets the case of the text to display to the user. (Default: Normal)

Instance member Checked

Boolean: Returns or sets whether a check mark appears next to the text of the menu item. (Default: False)

Throws:

Instance member Command

ICommand: Returns or sets the ICommand implementation to invoke. (Default: null)

Instance member Enabled

Boolean: Returns or sets whether the menu item is enabled. (Default: True)

Instance member Font

Font: Returns or sets the font of the menu item.

Instance member ForeColor

Color: Returns or sets the text color of the menu item.

Instance member Form

Form: Returns the Form that owns the Menu.

Instance member Icon

Image: Returns or sets the icon that is displayed by MenuItem.

Instance member IconSource

String: Returns or sets the theme name or URL for the icon to display in the MenuItem.

Instance member Index

Int32: Returns or sets a value indicating the position of the menu item in its parent menu.

Throws:

Instance member IsParent

Boolean: Returns a value indicating whether the menu item contains child menu items.

Instance member MdiList

Boolean: Returns or sets whether the menu item will be populated with a list of the Multiple Document Interface (MDI) child windows that are displayed within the associated form. (Default: False)

Int32: Returns the unique identifier for this menu item.

Instance member MergeOrder

Int32: Returns or sets a value indicating the relative position of the menu item when it is merged with another. (Default: 0)

Instance member MergeType

MenuMerge: Returns or sets a value indicating the behavior of this menu item when its menu is merged with another. (Default: Add)

Instance member Parent

Menu: The parent menu that contains this menu item

Instance member RadioCheck

Boolean: Returns or sets whether the MenuItem, if checked, displays a radio-button instead of a check mark. (Default: False)

Instance member Shortcut

Shortcut: Returns or sets a value indicating the shortcut key associated with the menu item. (Default: None)

Instance member ShowShortcut

Boolean: Returns or sets whether the shortcut key that is associated with the menu item is displayed next to the menu item caption. (Default: True)

Instance member SizeMode

MenuItemSizeMode: Returns or sets how the menu item is resized when in a MenuBar or MainMenu (Default: Auto)

Instance member SourceControl

Control: Returns the Control that owns the ContextMenu.

Instance member Text

String: Returns or sets a value indicating the text of the menu item. Use "-" to display the menu separator.

Instance member Visible

Boolean: Returns or sets whether the menu item is visible. (Default: True)

Methods

Instance member CloneMenu()

Creates a copy of the current MenuItem.

Returns: MenuItem. A MenuItem that represents the duplicated menu item.

Protected member CloneMenu(source, includeChildren)

Creates a copy of the specified MenuItem.

ParameterTypeDescription
sourceMenuItemThe MenuItem that represents the menu item to copy.
includeChildren optionalBooleanIndicates whether to clone the menu's child items.

Protected member Dispose(disposing)

Disposes of the resources (other than memory) used by the MenuItem.

ParameterTypeDescription
disposingBooleantrue when this method is called by the application rather than a finalizer.

Instance member MergeMenu()

Merges this MenuItem with another MenuItem and returns the resulting merged MenuItem.

Returns: MenuItem. A MenuItem that represents the merged menu item.

Protected member OnBackColorChanged(e)

Fires the BackColorChanged event.

ParameterTypeDescription
eEventArgsA EventArgs that contains the event data.

Protected member OnCheckedChanged(e)

Fires the CheckedChanged event.

ParameterTypeDescription
eEventArgsAn EventArgs that contains the event data.

Protected member OnClick(e)

Fires the Click event.

ParameterTypeDescription
eEventArgsAn EventArgs that contains the event data.

Protected member OnCommandChanged(e)

Fires the CommandChanged event.

ParameterTypeDescription
eEventArgsA EventArgs that contains the event data.

Protected member OnFontChanged(e)

Fires the FontChanged event.

ParameterTypeDescription
eEventArgsA EventArgs that contains the event data.

Protected member OnForeColorChanged(e)

Fires the ForeColorChanged event.

ParameterTypeDescription
eEventArgsA EventArgs that contains the event data.

Protected member OnInitMenuPopup(e)

Fires the Popup event.

ParameterTypeDescription
eEventArgsAn EventArgs that contains the event data.

Protected member OnPopup(e)

Fires the Popup event.

ParameterTypeDescription
eEventArgsAn EventArgs that contains the event data.

Protected member OnSelect(e)

Fires the Select event.

ParameterTypeDescription
eEventArgsAn EventArgs that contains the event data.

This event fires only if there is an handler attached to it. A simple overload of the On[Event] method in a derived class will not be invoked unless there is at least one handler attached to the event.

Protected member OnTextChanged(e)

Fires the TextChanged event.

ParameterTypeDescription
eEventArgsAn EventArgs that contains the event data.

Protected member OnWebEvent(e)

Processes the event from the client.

ParameterTypeDescription
eWisejEventArgsEvent arguments.

Protected member OnWebRender(config)

Renders the client component.

ParameterTypeDescription
configObjectDynamic configuration object.

Instance member PerformClick()

Generates a Click event for the MenuItem, simulating a click by a user.

Instance member PerformSelect()

Fires the Select event for this menu item.

Instance member Update()

Updates the component on the client.

Events

Instance member BackColorChanged

EventHandler Fired when the BackColor property value changes.

Instance member CheckedChanged

EventHandler Fired when the Checked property value changes.

Instance member Click

EventHandler Fired when the menu item is clicked or selected using a shortcut key or access key defined for the menu item.

Instance member CommandChanged

EventHandler Fired when the Command property value changes.

Instance member FontChanged

EventHandler Fired when the Font property value changes.

Instance member ForeColorChanged

EventHandler Fired when the ForeColor property value changes.

EventHandler Occurs before a menu item's list of menu items is displayed.

Instance member Select

EventHandler Fired when the user places the pointer over a menu item.

This event fires only if there is an handler attached to it. A simple overload of the On[Event] method in a derived class will not be invoked unless there is at least one handler attached to the event.

Instance member TextChanged

EventHandler Fired when the Text property value changes.

Inherited By

NameDescription
CheckedMenuItemRepresents an individual menu item that is displayed within a MainMenu or ContextMenu and always shows a checkbox next to the label.
LinkMenuItemRepresents an individual menu item that is displayed within a MainMenu or ContextMenu rendered using the <a> link element to let the browser process the specified HRef URL.

Implements

NameDescription
IUserDataProvides access to the UserData and Tag properties associated to the component implementing this interface.
IBindableComponentBindable components implement this interface.
ICommandSourceDefines an object that can invoke a Command.
IWisejComponentAll wisej components implement this interface.
IWisejSerializableAllows an object to serialize itself.