SetMenuExItemState

www.progui.co.uk  Top  Previous  Next

SetMenuExItemState()

Syntax

Success = SetMenuExItemState(Menu.i, ItemID.l, State.l)

Description

Sets a menu item's checkbox or radiocheck state. Menu.i is the Handle or ID of the menuEx that the item belongs to. ItemID.l is the ID of the item's state you wish to change. State.l can be one or more constant values determining the desired state of the item.

A checkbox can be displayed with the item by specifying State.l as #ItemEx_ShowCheckbox. In order to use the item's icon with the checkbox then specify State.l as #ItemEx_ShowCheckbox|#ItemEx_UseIcon.

A radiocheck group can be created by specifying State.l as #ItemEx_ShowRadiocheck. Any items in the same menu with this state will become part of the same radiocheck group unless State.l is #ItemEx_EndRadiocheckGroup or #ItemEx_ShowRadiocheck|#ItemEx_EndRadiocheckGroup (the next time an item's state is set to #ItemEx_ShowRadiocheck a new group will be created). The last item set with #ItemEx_ShowRadiocheck will be the default selected item. In order to use the item's icon as the radiocheck then specify state as #ItemEx_ShowRadiocheck|#ItemEx_UseIcon. Setting again a previously created checkgroup item's state to #ItemEx_ShowRadiocheck will make it the currently selected item.

To remove a checkbox from an item or remove an item from a radiocheck group then specify State.l as false.

Returns true for success or false for failure.

See GetMenuExItemState, MenuItemEx.

 

MenuEx Index