SaintAnger

Hi,

I know this might be in front of me ready to bite my head of but i dont seem to see it...

Basically i want to initialise my checkbox to be checked when the program runs and my frame appears. I have checked the properties of the checkBox but i do not seem to find the solution to this.

Any suggestions will be much appreciated!

Cheers

Anger.



Re: Visual C++ Language Check Boxes

Ch.T.Gopi Kumar

Add a class variable for the check box and use the SetCheck function as follows

m_btnCheck.SetCheck(BST_CHECKED); (Here m_btnCheck is the variable name for the check box))

Thanx.






Re: Visual C++ Language Check Boxes

Marius Bancila

Or do this:

((CButton*)GetDlgItem(IDC_BUTTON_ID))->SetCheck(BST_CHECKED);






Re: Visual C++ Language Check Boxes

SaintAnger

To check the check box:

SendMessage(GetDlgItem(hDlg, IDC_ADVANCEDTEST), BM_SETCHECK, (WPARAM) BST_CHECKED, 0);