MenuItem::DisplayName property

The DisplayName property returns the display name of the menu item. This property is read-only.

Syntax

Property DisplayName As String

Property value

The display name of the menu item.

Remarks

The display name returned by this property includes any accelerator key coding. For example, the string "&Properties ALT+ENTER" may be returned. The ampersand ("&") causes the letter "P" to be underlined when the menu is displayed to the user (as well as invoking the menu item if the user presses the letter P while the menu is active). The ALT+ENTER represents the shortcut key sequence (accelerator) that can be used to invoke the menu command.

Examples

Dim objMenuItem As MMC20.MenuItem
' Retrieve the first MenuItem in the ContextMenu object.
' objCtxMenu is an MMC20.ContextMenu object.
Set objMenuItem = objCtxMenu.Item(1)
 
' Display the MenuItem's DisplayName property.
MsgBox ("DisplayName: " & objMenuItem.DisplayName)
 
' Free the object when done.
Set objMenuItem = Nothing

Requirements

Minimum supported client
Windows Vista
Minimum supported server
Windows Server 2008
Header
MMCObj.h
IDL
MMCObj.idl
DLL
Mmcndmgr.dll
IID
IID_MenuItem is defined as 0178FAD1-B361-4B27-96AD-67C57EBF2E1D

See also

MenuItem.LanguageIndependentName

MenuItem.LanguageIndependentPath

ContextMenu.Item

ContextMenu object