CButton* bCheck1Obj=(CButton*)GetDlgItem(IDC_CHECK_1);
if(bCheck1Obj->GetCheck() == BST_CHECKED)
{
/* current state is checked. */
}
else if(bCheck1Obj->GetCheck() == BST_UNCHECKED)
{
/* current state is un-checked. */
}
else
{
}
/* 改變checkbox的state, 用SetCheck() */
bCheck1Obj->用SetCheck(BST_CHECKED); /* 選取checkbox */
bCheck1Obj->用SetCheck(BST_UNCHECKED); /* 選取checkbox */
Reference:
[1] http://mqjing.blogspot.tw/2007/04/mfc-checkbox.html
[2] http://msdn.microsoft.com/en-us/library/31deb72x(v=vs.80).aspx
沒有留言:
張貼留言