How to : Auf Button druck checkbox abfragen

  • Wie kann ich wenn ein Button gedrückt wird fragen: Ist checkbox Haken oder nicht Haken ?
    Das Beispiel in der Hilfe liefert da leider keine auskunft.

    Danke im vorraus

    mfg Ubuntu

  • so ?

    [autoit]

    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", 174, 50, 192, 124)
    $Button1 = GUICtrlCreateButton("Check", 8, 16, 75, 25, $WS_GROUP)
    $Checkbox1 = GUICtrlCreateCheckbox("Check ?!", 88, 16, 97, 17)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    [/autoit][autoit][/autoit][autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    if GUICtrlRead($Checkbox1) = $GUI_CHECKED Then
    MsgBox(0,"","Haken vorhanden !")
    Else
    MsgBox(0,"","Kein Haken vorhanden !")
    EndIf

    [/autoit][autoit][/autoit][autoit][/autoit][autoit]

    EndSwitch
    WEnd

    [/autoit]