NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

MenuItem.ShowShortcut

Gets or sets a value that indicates whether the shortcut key that is assocaited with the menu item is displayed next to the menu item caption.

[Visual Basic]
Public Property ShowShortcut As Boolean
[C#]
public bool ShowShortcut {get; set;}
[C++]
public: __property bool get_ShowShortcut();
public: __property void set_ShowShortcut(bool);
[JScript]
public function get ShowShortcut() : Boolean;
public function set ShowShortcut(Boolean);

Property Value

true if the shortcut key combination is displayed next to the menu item caption; false if the shortcut key combination is not to be displayed. The default is true.

Example [Visual Basic]

The following example creates a menu item, sets the caption, assigns a shortcut key, makes the menu item visible, and shows the shortcut key display for the menu item. The example assumes a MenuItem object has been created that is named MenuItem1.

[Visual Basic]

Public Sub SetupMyMenuItem()
   ' Set the caption for the menu item.
   MenuItem1.Text = "&New"
   ' Assign a shortcut key.
   MenuItem1.Shortcut = Shortcut.CtrlN
   ' Make the menu item visible.
   MenuItem1.Visible = True
   ' Display the shortcutkey combination.
   MenuItem1.ShowShortcut = True
End Sub

See Also

MenuItem Class | MenuItem Members | System.WinForms Namespace | Shortcut