Click or drag to resize

MenuSelectEvent Class

X#
Provide information about a MenuSelectEvent, generated whenever a menu item is highlighted on a menu (menu items are highlighted as the user moves either the mouse or the highlight bar up or down a menu).
Inheritance Hierarchy
Object
  Event
    MenuSelectEvent

Namespace:  VO
Assembly:  VOGUIClasses (in VOGUIClasses.dll) Version: 2.19
Syntax
 CLASS MenuSelectEvent INHERIT Event
Request Example View Source

The MenuSelectEvent type exposes the following members.

Constructors
  NameDescription
Public methodMenuSelectEvent
Initializes a new instance of the MenuSelectEvent class
Top
Properties
  NameDescription
Public propertyHandle
The pointer to the window where the event occurred
(Inherited from Event.)
Public propertyHyperLabel
The hyperlabel connected to the menu that generated this MenuSelectEvent. From the hyperlabel, you can retrieve additional information about the menu.
Public propertyItemID
A numeric value representing the ID of the menu item that generated this MenuSelectEvent.
Public propertyMenu
The Menu object that generated this MenuSelectEvent.
Public propertyMessage
A dword representing the Windows API message associated with the given event.
(Inherited from Event.)
Public propertyName
A string representing the name stored in the hyperlabel of the menu items that generated this MenuSelectEvent.
Public propertyNameSym
A symbol representing the name stored in the hyperlabel of the menu items that generated this MenuSelectEvent.
Public propertyWindow
An object indicating the window or control in which the event occurred. This is helpful, for example, for distinguishing between similar menu events coming from the same context menu attached to different controls.
(Inherited from Event.)
Top
Methods
  NameDescription
Public methodAsString
Return the caption of the selected menu item.
Top
Fields
  NameDescription
Public fieldhWnd (Inherited from Event.)
Public fieldlParam (Inherited from Event.)
Public fieldoWindow (Inherited from Event.)
Public fielduMsg (Inherited from Event.)
Public fieldwParam (Inherited from Event.)
Top
Remarks
MenuSelectEvent events enable the program to anticipate that the user can activate an item or to provide status information.
Tip Tip
When a menu item is actually selected (and therefore executed), the system generates a MenuCommandEvent.
When an accelerator key is executed, a MenuSelectEvent, immediately followed by a MenuCommandEvent, is generated to simulate the mouse route—the various selections that you have to pass over to choose the option. (Thus, the accelerator generates the same event as those generated with a mouse.)
Examples
The following example prints a different help line in the status bar, depending on which command is currently selected:
X#
 1CLASS MyWindow INHERIT TopAppWindow
 2METHOD MenuSelect(oMSE) CLASS MyWindow
 3LOCAL j := oMSE:ItemID
 4DO CASE
 5CASE j = IDMI_RED
 6TextPrint("Select the Red Pen", Point{10,10})
 7CASE j = IDMI_GREEN
 8TextPrint("Select the Green Pen", Point{10,10})
 9CASE j = IDMI_BLUE
10TextPrint("Select the Blue Pen", Point{10,10})
11ENDCASE
See Also

Reference