Vladi243 0 Report post Posted June 21, 2008 How to uncheck automatically one checkbox while the other checked? I searched in the forum and the help file, and haven't found an answer. Share this post Link to post Share on other sites
monoceres 183 Report post Posted June 21, 2008 Like this maybe: #include <GUIConstantsEx.au3> Opt("GuiOnEventMode", 1) GUICreate("Checkboxes") GUISetOnEvent($GUI_EVENT_CLOSE, "close") $cb1 = GUICtrlCreateCheckbox("Check me!", 10, 10) GUICtrlSetOnEvent(-1, "_Checked") $cb2 = GUICtrlCreateCheckbox("Checkers!", 10, 50) GUISetState() Do Sleep(10) Until False Func close() Exit EndFunc ;==>close Func _Checked() If BitAND(GUICtrlRead($cb1), $GUI_CHECKED) = $GUI_CHECKED Then GUICtrlSetState($cb2, $GUI_UNCHECKED) Else GUICtrlSetState($cb2, $GUI_CHECKED) EndIf EndFunc ;==>_Checked Broken link? PM me and I'll send you the file! Share this post Link to post Share on other sites
Vladi243 0 Report post Posted June 21, 2008 I've already thought about it by self, but it's not working. Any other idea? Share this post Link to post Share on other sites
Cater 0 Report post Posted June 21, 2008 (edited) #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 153, 191, 193, 125) $Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 32, 24, 97, 17) $Checkbox2 = GUICtrlCreateCheckbox("Checkbox2", 32, 80, 97, 17) $Checkbox3 = GUICtrlCreateCheckbox("Checkbox3", 32, 128, 97, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch If GUICtrlRead($checkbox2) = 1 And GUICtrlRead($checkbox3) = 1 Then GUICtrlSetState($checkbox1, $GUI_UNCHECKED) EndIf WEnd Always when $checkbox2 and $checkbox3 are checked $checkbox1 are unchecked. Edited June 21, 2008 by Cater Share this post Link to post Share on other sites
monoceres 183 Report post Posted June 21, 2008 I've already thought about it by self, but it's not working.Any other idea?Uhm, I think my example works very well.If you need both boxes working just add the event for the other one as well. Broken link? PM me and I'll send you the file! Share this post Link to post Share on other sites