From Xojo Documentation

Read-Only Property (As Integer )
IntegerValue = aMenuItem.Handle(type As HandleType)

Supported for all project types and targets.

Provides access to the appropriate underlying platform menu implementation.


If the requested handle type doesn't make sense for the platform the application is running on, a PlatformNotSupportedException is raised.

MenuItem.HandleType enumeration:

  • CocoaNSMenuItem: Returns the underlying NSMenuItem. If there is a submenu, the NSMenu can be got through NSMenuItem's submenu method.
  • WindowsParentHMENU: Returns the HMENU of the MenuItem if it is a submenu, otherwise it returns the parent's HMENU
  • WindowsCommandID: Returns the unique menu item identifier for the MenuItem, used by various Win32 APIs such as GetMenuItemInfo