Partager via


CToolBarCtrl::SetState

Sets the state for the specified button in a toolbar control.

BOOL SetState(
   int nID,
   UINT nState 
);

Parameters

  • nID
    Command identifier of the button.

  • nState
    State flags. It can be a combination of the values listed for button states in CToolBarCtrl::AddButtons.

Return Value

Nonzero if successful; otherwise zero.

Remarks

This function is especially handy if you want to set more than one of the button states. To just set one state, use one of the following member functions: EnableButton, CheckButton, HideButton, Indeterminate, or PressButton.

Requirements

Header: afxcmn.h

See Also

Concepts

CToolBarCtrl Class

CToolBarCtrl Members

Hierarchy Chart

CToolBarCtrl::GetState

CToolBarCtrl::AddButtons

CToolBarCtrl::EnableButton

CToolBarCtrl::CheckButton

CToolBarCtrl::HideButton

CToolBarCtrl::Indeterminate

CToolBarCtrl::PressButton