CToolBarCtrl::GetState

Retrieves information about the state of the specified button in a toolbar control, such as whether it is enabled, pressed, or checked.

int GetState(
   int nID 
) const;

Parameters

  • nID
    Command identifier of the button for which to retrieve information.

Return Value

The button state information if successful or – 1 otherwise. The button state information can be a combination of the values listed in CToolBarCtrl::AddButtons.

Remarks

This function is especially handy if you want to retrieve more than one of the button states. To just retrieve one state, use one of the following member functions: IsButtonEnabled, IsButtonChecked, IsButtonPressed, IsButtonHidden, or IsButtonIndeterminate. However, the GetState member function is the only way to detect the TBSTATE_WRAP button state.

Requirements

Header: afxcmn.h

See Also

Concepts

CToolBarCtrl Class

CToolBarCtrl Members

Hierarchy Chart

CToolBarCtrl::SetState

CToolBarCtrl::GetItemRect

CToolBarCtrl::IsButtonEnabled

CToolBarCtrl::IsButtonChecked

CToolBarCtrl::IsButtonPressed

CToolBarCtrl::IsButtonHidden

CToolBarCtrl::IsButtonIndeterminate