CWnd::CheckDlgButton

选择(有一个复选标记旁边)或清除(移除选中标记从)按钮,或者更改三个状态按钮的状态。

void CheckDlgButton(
   int nIDButton,
   UINT nCheck 
);

参数

  • nIDButton
    指定按钮将修改。

  • nCheck
    指定该操作。 如果 nCheck 不为零,CheckDlgButton 成员函数中按钮旁放置一个复选标记;如果中,选中标记移除0。 对于三个状态按钮,则为; nCheck 为2,按钮状态是不确定的。

备注

CheckDlgButton 函数将 BM_SETCHECK 信息到指定的按钮。

示例

// 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
}

要求

Header: afxwin.h

请参见

参考

CWnd 类

层次结构图

创建

CButton::SetCheck

CheckDlgButton