how can I make IDC_CHECK1 checked from another object (OnEditchangeComboemployee() )? I tried: void CScheduleDlg::OnEditchangeComboemployee() { m_checked=TRUE;//member variable of IDC_CHECK1 } but it didn't do anything
: how can I make IDC_CHECK1 checked from another object (OnEditchangeComboemployee() )? I tried: : void CScheduleDlg::OnEditchangeComboemployee() : { : m_checked=TRUE;//member variable of IDC_CHECK1 : } : but it didn't do anything : :
[blue]This question really belongs on the MFC board, but I'll answer it anyway. checkboxes are CButton object, so if you look at the methods provided by CButton you will find SetCheck(int value); [code] CButton *pCheckbox = (CButton *)GetDlgIdem(IDC_CHECK1); if(pCheckBox != NULL) pCheckBox->SetCheck(BST_CHECKED); [/code]
Comments
: void CScheduleDlg::OnEditchangeComboemployee()
: {
: m_checked=TRUE;//member variable of IDC_CHECK1
: }
: but it didn't do anything
:
:
[blue]This question really belongs on the MFC board, but I'll answer it anyway. checkboxes are CButton object, so if you look at the methods provided by CButton you will find SetCheck(int value);
[code]
CButton *pCheckbox = (CButton *)GetDlgIdem(IDC_CHECK1);
if(pCheckBox != NULL)
pCheckBox->SetCheck(BST_CHECKED);
[/code]