Jump to content

Recommended Posts

Posted

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!

Posted (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 by Cater
Posted

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!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...