MENU SET STATE statement  

Purpose

Set the state of a specified menu item.

Syntax

MENU SET STATE hMenu, [BYCMD] position&, state&

Remarks

Change the state of the menu item identified by position&.

hMenu

Double-word or Long-integer variable containing the handle of the menu that contains the item to change.

position&

Position within the menu, of the menu item to be changed. If the BYCMD option is specified, position& refers to the unique menu item identifier of the item. Otherwise, position& indicates the physical position of the menu item within the menu, where position& = 1 for the first position, position& = 2 for the second position, and so on.

state&

The new state of the menu item. This must be one or more of the following items, combined together with the OR operator to form a bitmask:

%MFS_CHECKED

Place a checkmark next to the item.

%MFS_DEFAULT

The default menu item, displayed in bold.  Only one item may be the default.

%MFS_DISABLED

Disable the menu item so that it cannot be selected.

%MFS_ENABLED

Enable the menu item so that it can be selected.

%MFS_GRAYED

Disable the menu item so that it cannot be selected, and draw it in a "grayed" state to indicate this.

%MFS_HILITE

Highlight the menu item.

%MFS_UNCHECKED

Removes any checkmark next to the item.

%MFS_UNHILITE

Removes the highlight from the item.

See also

Dynamic Dialog Tools, Menus, MENU ADD POPUP, MENU ADD STRING, MENU ATTACH, MENU CONTEXT, MENU DELETE, MENU DRAW BAR, MENU GET STATE, MENU GET TEXT, MENU NEW BAR, MENU NEW POPUP, MENU SET TEXT