Freigeben über


CButton::SetState

Sets whether a button control is highlighted or not.

void SetState(
   BOOL bHighlight 
);

Parameters

  • bHighlight
    Specifies whether the button is to be highlighted. A nonzero value highlights the button; a 0 value removes any highlighting.

Remarks

Highlighting affects the exterior of a button control. It has no effect on the check state of a radio button or check box.

A button control is automatically highlighted when the user clicks and holds the left mouse button. The highlighting is removed when the user releases the mouse button.

Example

CButton myPushButton;

// Create a push button.
myPushButton.Create(_T("My button"), WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON, 
   CRect(10,10,100,30), pParentWnd, 1);

// Invert the highlight state of the button.
myPushButton.SetState(!(myPushButton.GetState() & 0x0004));

Requirements

Header: afxwin.h

See Also

Reference

CButton Class

Hierarchy Chart

CButton::GetState

CButton::SetCheck

CButton::GetCheck

BM_SETSTATE

Other Resources

CButton Members