Constructor MenuItem
MenuItem()
Initializes a new instance of the MenuItem class.
public MenuItem()
MenuItem(string?, KeyGesture)
Initializes a new instance of the MenuItem class with
the specified text and shortcut for the menu item.
public MenuItem(string? text, KeyGesture shortcut)
Parameters
textstringshortcutKeyGesture
MenuItem(string?, Image?, EventHandler)
Initializes a new instance of the MenuItem class that displays the specified text and image and that does the specified action when the MenuItem is clicked.
public MenuItem(string? text, Image? image, EventHandler onClick)
Parameters
textstringThe text to display on the menu item.
imageImageThe Image to display on the control.
onClickEventHandlerAn event handler that raises the Click event when the control is clicked.
MenuItem(string?)
Initializes a new instance of the MenuItem class with
the specified text for the menu item.
public MenuItem(string? text)
Parameters
textstring
MenuItem(string?, EventHandler?, KeyGesture?)
Initializes a new instance of the MenuItem class with
the specified text, onClick and
shortcut for the menu item.
public MenuItem(string? text, EventHandler? onClick = null, KeyGesture? shortcut = null)
Parameters
textstringonClickEventHandlershortcutKeyGesture
MenuItem(string?, Action?)
Initializes a new instance of the MenuItem class with
the specified text and onClick
for the menu item.
public MenuItem(string? text, Action? onClick)
Parameters
MenuItem(string?, Func<bool>?)
Initializes a new instance of the MenuItem class with
the specified text and onClick
for the menu item.
public MenuItem(string? text, Func<bool>? onClick)
Parameters
MenuItem(string?, Action?, KeyGesture?)
Initializes a new instance of the MenuItem class with
the specified text, onClick and
shortcut for the menu item.
public MenuItem(string? text, Action? onClick, KeyGesture? shortcut)
Parameters
textstringonClickActionshortcutKeyGesture