Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: C++
Expertise: Beginner
Nov 25, 2008

Controlling Checkboxes in MFC

Here's how to check, uncheck, enable, and disable a checkbox in MFC:

  CButton* pBtn = (CButton*) GetDlgItem(IDC_SETUP_AM);
  pBtn->SetCheck(0);// uncheck it
  CButton* pBtn = (CButton*) GetDlgItem(IDC_SETUP_AM);
  pBtn->SetCheck(1);// check it
  CButton* pBtn = (CButton*) GetDlgItem(IDC_SETUP_AM);
  pBtn->EnableWindow(0);// disable it
  CButton* pBtn = (CButton*) GetDlgItem(IDC_SETUP_AM);
  pBtn->EnableWindow(1);// enable it
Larry A. Mills, Sr.
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap