SetItemState

Description

Sets the state of a toolbar item.

Applies to

Toolbar controls

Syntax

Integer controlname.SetItemState ( toolbarindex, itemstate)

Argument

Description

controlname

The name of the toolbar control

toolbarindex

Integer for the index of the toolbar item

itemstate

Integer value to indicate the state of the toolbar item that you want to set. Values are:

  • 1 Sets a StyleCheck! or StyleCheckGroup! toolbar button in the depressed state

  • 2 Sets a StyleButton! toolbar button in a transitional depressed state

  • 4 Enables a toolbar item for selection

  • 32 Sets the next item in the toolbar on a separate line if it is not part of the same group

Values are additive. For example, suppose you want to set a toolbar button with the checked state (1) and enable it (4), with the next set of buttons wrapped to a different line (32). You would enter 37 for the itemstate argument.

Returns

Integer. Returns 1 for success and -1 if an error occurs.

Examples

Example 1

The following example sets the state for the second item in the toolbar:

Integer li_rtn

li_rtn = tlbr_mytoolbar.SetItemState(2, 33)

See also