cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
davidknechtges
Level 3

Checkbox help?

I have a dialog with several checkboxes on it. I can set the initial state of the checkboxes like I want - either checked or unchecked.

What I also want to do is to set the state of some of the checkboxes when another is clicked at runtime. So for example, the state of checkbox B is dependent on whether checkbox A is checked or not.

So, when the user clicks checkbox A to check it, I want to uncheck checkbox B.

Can someone explain how I can do that?

Thanks!
Labels (1)
0 Kudos
(1) Reply
kayaker
Level 4

here's a very simple example, though not complete but you can see the key logic to control the checkbox behavior...


function SampleDlg()
//please define some variable by yourself....

#define CHECKBOX_A 123 // ID Of checkbox a
#define CHECKBOX_B 123 // ID Of checkbox b

begin
nResult = EzDefineDialog( szDialogName, "", "", DIALOG_ID);


// Display the dialog box and return the next dialog box event.
nCmdValue = WaitOnDialog(szDialogName);
switch (nCmdValue)
case CHECKBOX_A:

if (CtrlGetState( szDialogName, CHECKBOX_A)= BUTTON_CHECKED) then
//add code to uncheck CHECKBOX_B;
endif;
case XXX:
....
endswitch;

end;
0 Kudos