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.Text

Gets or sets the text of the menu item.

[Visual Basic]
Public Property Text As String
[C#]
public string Text {get; set;}
[C++]
public: __property String* get_Text();
public: __property void set_Text(String*);
[JScript]
public function get Text() : String;
public function set Text(String);

Property Value

The caption of the menu item.

Remarks

When you specify a caption for your menu item with the Text property, you can also specify an accelerator key by placing an '&' before the character to be used as the accelerator key. For example, to specify the "F" in "File" as an accelerator key, you would specify the caption for the menu item as "&File".

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