void SetCheck( int nCheck );
Parameters
nCheck
Specifies the check state. This parameter can be one of the following:
Value | Meaning |
0 | Set the button state to unchecked. |
1 | Set the button state to checked. |
2 | Set the button state to indeterminate. This value can be used only if the button has the BS_3STATE or BS_AUTO3STATE style. |
Remarks
Sets or resets the check state of a radio button or check box. This member function has no effect on a pushbutton.
Example
CButton myButton;
// Create an auto 3-state button.
myButton.Create(_T("My button"), WS_CHILD|WS_VISIBLE|BS_AUTO3STATE,
CRect(10,10,100,30), pParentWnd, 1);
// Set the check state to indeterminate.
myButton.SetCheck( 2 );
CButton Overview | Class Members | Hierarchy Chart
See Also CButton::GetCheck, CButton::GetState, CButton::SetState, BM_SETCHECK