Export (0) Print
Expand All
MFC
Expand Minimize
1 out of 1 rated this helpful - Rate this topic

CWnd::CheckDlgButton 

Selects (places a check mark next to) or clears (removes a check mark from) a button, or it changes the state of a three-state button.


void CheckDlgButton(
   int nIDButton,
   UINT nCheck 
);

Parameters

nIDButton

Specifies the button to be modified.

nCheck

Specifies the action to take. If nCheck is nonzero, the CheckDlgButton member function places a check mark next to the button; if 0, the check mark is removed. For three-state buttons, if nCheck is 2, the button state is indeterminate.

The CheckDlgButton function sends a BM_SETCHECK message to the specified button.

// Sets 3 check buttons in various ways.  Note BST_INDETERMINATE
// requires BS_3STATE or BS_AUTO3STATE in the button's style.
void CMyDlg::OnMarkButtons() 
{
   CheckDlgButton(IDC_CHECK1, BST_UNCHECKED);   // 0
   CheckDlgButton(IDC_CHECK2, BST_CHECKED);   // 1
   CheckDlgButton(IDC_CHECK3, BST_INDETERMINATE);   // 2
}
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.