Each button in a toolbar has a current state that indicates whether the button is hidden or visible, enabled or disabled, and pressed or not pressed. You set a button's initial state when adding the button to the toolbar, and the toolbar updates the button state in response to a user's actions, for example, when the user taps it with the stylus. You can use the TB_GETSTATE and TB_SETSTATE messages to retrieve and set the state of a button.
Toolbar button states that are the same in both Windows CE and Windows-based desktop platforms are described in the following table.
State | Description | |
---|---|---|
TBSTATE_CHECKED | The button has the TBSTYLE_CHECKED style and is being pressed. | |
TBSTATE_ENABLED | The button accepts user input. A button without this state does not accept user input and is grayed. | |
TBSTATE_HIDDEN | The button is not visible and cannot receive user input. | |
TBSTATE_HIGHLIGHTED | The button is highlighted. | |
TBSTATE_INDETERMINATE | The button is grayed. | |
TBSTATE_PRESSED | The button is being pressed. | |
TBSTATE_WRAP | The button has a line break following it. The button must also have the TBSTATE_ENABLED state. |
The toolbar button state TBSTATE_ELLIPSES is unique to Windows CE. When a button has this style, if its text does not fit the size of the button, the text is cut off and ellipses are displayed.