Checkbox vor eingestellt auf ausgewählt

  • Jo ich möchte das eine checkbox schon ein häkchen drinne hat wenn ich das fenster auf mach^^
    Ich habe schon nen bissel mit GuiCtrlSetState usw. rum probiert habe aber noch nix raus bekommen :/

    Hier mal nen beispiel:

    Code
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", 116, 66, 193, 125)
    $Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 16, 8, 97, 17, 0,$vordingertz, )
    $Button1 = GUICtrlCreateButton("Button1", 24, 32, 75, 25, 0)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###


    (so und da soll wenn das fenster af geht in der checkbox schon nen haken drinne sein

    Einmal editiert, zuletzt von TheLol (12. April 2008 um 00:43)

  • Thx, für die fixe Antwort :D

    aber es funzt nicht^^:
    Da kommt nen error:

    [autoit]


    #include <GuiConstants.au3>
    GUICtrlSetState($Checkbox1, $GUI_CHECKED)
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", 116, 66, 193, 125)
    $Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 16, 8, 97, 17)
    $Button1 = GUICtrlCreateButton("Button1", 24, 32, 75, 25, 0)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    [/autoit]

    Und wenn man das Probiert, passiert gar nix:

    [autoit]


    #include <GuiConstants.au3>
    $Checkbox1 = 0
    GUICtrlSetState($Checkbox1, $GUI_CHECKED)
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", 116, 66, 193, 125)
    $Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 16, 8, 97, 17)
    $Button1 = GUICtrlCreateButton("Button1", 24, 32, 75, 25, 0)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    [/autoit]


    €dit: sry habs grade gepeilt xD, ich habs an die falsche stelle gesetzt -.-

    So ists richtig:

    [autoit]


    #include <GuiConstants.au3>
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", 116, 66, 193, 125)
    $Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 16, 8, 97, 17)
    $Button1 = GUICtrlCreateButton("Button1", 24, 32, 75, 25, 0)
    GUICtrlSetState($Checkbox1, $GUI_CHECKED)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    Sleep (1000)
    WEnd

    [/autoit][autoit][/autoit][autoit][/autoit]
  • Hallo,

    es ist auch diese Schreibweise möglich. ;)

    Spoiler anzeigen
    [autoit]


    #include <GuiConstants.au3>
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", 116, 66, 193, 125)
    $Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 16, 8, 97, 17)
    GUICtrlSetState(-1, $GUI_CHECKED) ;<====== oder auch so !
    $Button1 = GUICtrlCreateButton("Button1", 24, 32, 75, 25, 0)
    ;GUICtrlSetState($Checkbox1, $GUI_CHECKED)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    Sleep (1000)
    WEnd

    [/autoit]

    Herzlich Willkommen und weiterhin viel Erfolg !