From Xojo Documentation

Revision as of 13:47, 27 August 2013 by PLefebvre (talk | contribs) (Created page with "<ShowIf version=2013r3> {{PropertyBox | name=Handle | owner=MenuItem | ownertype=class | scope=public | parameters=type As HandleType | type=Integer | platform=all | r...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

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