if(UpdateData()) { CButton* pBtsBitmapButton = (CButton*) GetDlgItem(IDC_BTSBITMAP); CButton* pChekBox = (CButton*) GetDlgItem(IDC_CHECK_LALALA); ASSERT(pBtsBitmapButton && pChekBox); if(pBtsBitmapButton && pChekBox) { if(BST_CHECKED == pChekBox->GetCheck()) { pBtsBitmapButton->EnableWindow(FALSE); } else pBtsBitmapButton->EnableWindow(TRUE); } }