Link to home
Start Free TrialLog in
Avatar of rose337
rose337

asked on

Check Box

Hi... I have a dialog based MFC application with a button on it to go to a property sheet. On the property sheet, I have a check box. The constructor of the property sheet sets the checkbox to FALSE. This means that whenever I open the property sheet, the checkbox is always off, even though I may change it to on, exit the property sheet and then go back into the property sheet. You may have guessed my question now... how do I get the checkbox to remember its previous state? I have added code in the constructor with a variable to change when the state of the check box changes so I have something like this in the constructor
int check;
BOOL checkbox;
if (check == 1)
checkbox = TRUE;
This code works great. However when I try to edit the code and go into the class wizard, I get a parsing error that it was not expecting a "==" and that it was expecting a "=", and all hell breaks loose. So, how do I recall a state of the checkbox without upsetting class wizard? Thanx


Avatar of nietod
nietod

The code you have posted looks fine and should not cause a parsing error unless you placed it in the wrong place in your program.  however, I don't see how that code can help you at all.  
If you need to "remember" the state of the checkbox, you will need to store its state in a global varaible or in a static variable that is a member of the class.
ASKER CERTIFIED SOLUTION
Avatar of Norbert
Norbert
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial