Checkbox Haken setzen

  • Ich möchte Checkboxen in Abhängigkeit vom Programmverlauf mit einem Haken versehen. So wie es unten versuche, klappt es nicht.

    Kann mir jemand einen Tip geben?

    Danke.

    #include <GUIConstants.au3>

    GUICreate("My GUI Checkbox") ; will create a dialog box that when displayed is centered
    $checkCN = GUICtrlCreateCheckbox ("CHECKBOX 1", 10, 10, 120, 20)

    ;setze Haken in Checkbox
    ;so funktioniert es nicht
    GUICtrlSetData ( $checkCN, "1")

    GUISetState () ; will display an dialog box with 1 checkbox

    ; Run the GUI until the dialog is closed
    While 1
    $msg = GUIGetMsg()

    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    Wend

  • [autoit]


    #include <GUIConstants.au3>

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

    GUICreate("My GUI Checkbox") ; will create a dialog box that when displayed is centered
    $checkCN = GUICtrlCreateCheckbox ("CHECKBOX 1", 10, 10, 120, 20)

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

    ;setze Haken in Checkbox
    ;so funktioniert es nicht
    GUICtrlSetState ( $checkCN, $GUI_CHECKED)

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

    GUISetState () ; will display an dialog box with 1 checkbox

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

    ; Run the GUI until the dialog is closed
    While 1
    $msg = GUIGetMsg()

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

    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    Wend

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

    der Haken ist ein Status der Checkbox und nicht Data mit Data änderst du nur den Text von CHECKBOX1 zu 1