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 Constructor (String)

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

[Visual Basic]
Overloads Public Sub New( _
   ByVal text As String _
)
[C#]
public MenuItem(
   string text
);
[C++]
public: MenuItem(
   String* text
);
[JScript]
public function MenuItem(
   text : String
);

Parameters

text
The caption for the menu item.

Remarks

When you specify a caption for your menu item with theparameter, 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 TBD that specifies the caption of the menu item at the time it is constructed.

[Visual Basic]

Public Sub CreateMyMenus()
   ' Create an instance of a MenuItem with a specific caption.
   Dim MenuItem1 as MenuItem
   Set MenuItem1 = New MenuItem("&File")
End Sub

See Also

MenuItem Class | MenuItem Members | System.WinForms Namespace | MenuItem Constructor Overload List