Application.SetMenu

Application.SetMenu (

table Menu )

Description

Sets the application's menu contents.

Note: "Show menu bar" setting must be checked on the Menu Bar dialog in order for this action to work.

Parameters

Menu

(table) A table of menu information, indexed by the following keys:

KEY

TYPE

DESCRIPTION

ID

number

The numeric ID of the menu item.

Text

string

The text of the menu item.  Use & before a letter to specify a mnemonic. Note that to create a separator item, set the item's Text to "---". In this case the ID, Checked, Enabled and SubTable items are ignored. Separator items will never fire an On Menu event.

IconID

number

The 0-based icon index from the Image List specified on the Menu Bar to use for the menu item.

Enabled

boolean

Whether the menu item is enabled.

Checked

boolean

Whether the menu item is checked.

SubMenu

table

A numerically indexed table of menu item tables. This creates a pop-up menu for this item.  Note that if a SubTable is specified this menu item will never fire the On Menu event.  Instead it's sub-items will fire the event.

Returns

Nothing. You can use Application.GetLastError to determine whether this action failed, and why.

See also:  Related Actions