checkbox zweites Programm zu ordnen.

  • Hallo alle Zusammen!

    Ich wollte mich mal mit der Checkbox befassen und peer erklärung von Kamin das man denn Skript kürzer gestahlten kann. Nun mein Problem wie man sieht ist in der Checkbox ein mal der MSPaint und beim anderen Notepad eingetragen sind, meine genaue Frage ist die wie bekomme ich es hin das ich auch denn Notepad.exe so wie es bei Mspaint schon ist mit einbaue. Muss ich ein 2 DIM erstellen.????


    Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=
    Dim $Checkbox[2]
    $Form1 = GUICreate("Form1", 450, 178, 251, 139)
    $Start = GUICtrlCreateButton("Start", 304, 120, 137, 49)
    $Alle = GUICtrlCreateButton(" Alle Auswählen", 152, 120, 137, 49)
    $kein = GUICtrlCreateButton("Keine Auswahl", 8, 120, 137, 49)
    $Checkbox[0] = GUICtrlCreateCheckbox("Paint", 10, 39, 121, 25)
    GUICtrlSetFont(-1, 12, 400, 0, "arial")
    $Checkbox[1] = GUICtrlCreateCheckbox("Notepad", 10, 80, 121, 25)
    GUICtrlSetFont(-1, 12, 400, 0, "arial")
    $Label1 = GUICtrlCreateLabel("Checkbox test", 123, 10, 191, 36)
    GUICtrlSetFont(-1, 20, 800, 0, "arial")
    GUICtrlSetColor(-1, 0x006AB9)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

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

    Case $Start
    For $i = 0 To 1
    If GUICtrlRead($Checkbox[$i]) = $GUI_CHECKED Then RunWait ('mspaint.exe')
    Next
    Case $Alle
    For $i = 0 To 1
    GUICtrlSetState($Checkbox[$i], $GUI_CHECKED)
    Next
    Case $kein
    For $i = 0 To 1
    GUICtrlSetState($Checkbox[$i], $GUI_UNCHECKED)
    Next
    EndSwitch
    WEnd

    [/autoit]


    Danke schon mal im vorraus.

    MfG

    Baron

    • Offizieller Beitrag
    Spoiler anzeigen
    [autoit]

    #Region - Timestamp
    ; 2012-02-26 14:15:47
    #EndRegion

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

    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=
    Dim $Checkbox[2]
    $Form1 = GUICreate("Form1", 450, 178, 251, 139)
    $Start = GUICtrlCreateButton("Start", 304, 120, 137, 49)
    $Alle = GUICtrlCreateButton(" Alle Auswählen", 152, 120, 137, 49)
    $kein = GUICtrlCreateButton("Keine Auswahl", 8, 120, 137, 49)
    $Checkbox[0] = GUICtrlCreateCheckbox("Paint", 10, 39, 121, 25)
    GUICtrlSetFont(-1, 12, 400, 0, "arial")
    $Checkbox[1] = GUICtrlCreateCheckbox("Notepad", 10, 80, 121, 25)
    GUICtrlSetFont(-1, 12, 400, 0, "arial")
    $Label1 = GUICtrlCreateLabel("Checkbox test", 123, 10, 191, 36)
    GUICtrlSetFont(-1, 20, 800, 0, "arial")
    GUICtrlSetColor(-1, 0x006AB9)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

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

    Case $Start
    If BitAND(GUICtrlRead($Checkbox[0]) ,$GUI_CHECKED) Then Run ('mspaint.exe')
    If BitAND(GUICtrlRead($Checkbox[1]) ,$GUI_CHECKED) Then Run ('Notepad.exe')
    Case $Alle
    For $i = 0 To 1
    GUICtrlSetState($Checkbox[$i], $GUI_CHECKED)
    Next
    Case $kein
    For $i = 0 To 1
    GUICtrlSetState($Checkbox[$i], $GUI_UNCHECKED)
    Next
    EndSwitch
    WEnd

    [/autoit]
  • Hi, Du kannst aber auch den Status der Checkboxen switchen (wie ein Kippschalter), dann sparst Du dir die Button. 8)

    [autoit]


    #region ### START Koda GUI section ###
    Global $tate = 4, $aCheckbox[2]
    GUICreate("Status Switch", 450, 178)
    $close = GUICtrlCreateButton("Beenden", 304, 120, 137, 49)
    $tart = GUICtrlCreateButton("Start", 152, 120, 137, 49)
    $all = GUICtrlCreateButton("All off/on", 8, 120, 137, 49)
    $aCheckbox[0] = GUICtrlCreateCheckbox("Paint", 10, 39, 121, 25)
    GUICtrlSetFont(-1, 12, 400, 0, "arial")
    $aCheckbox[1] = GUICtrlCreateCheckbox("Notepad", 10, 80, 121, 25)
    GUICtrlSetFont(-1, 12, 400, 0, "arial")
    GUICtrlCreateLabel("Checkbox test", 123, 10, 191, 36)
    GUICtrlSetFont(-1, 20, 800, 0, "arial")
    GUICtrlSetColor(-1, 0x006AB9)
    GUISetState(@SW_SHOW)
    #endregion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case -3, $close
    ExitLoop
    Case $tart
    If BitAND(GUICtrlRead($aCheckbox[0]), 1) Then Run('mspaint.exe')
    If BitAND(GUICtrlRead($aCheckbox[1]), 1) Then Run('Notepad.exe')
    Case $all
    $tate = BitXOR($tate, 1, 4)
    For $k = 0 To 1 ;i statisch kein Ubound
    GUICtrlSetState($aCheckbox[$k], $tate)
    Next
    EndSwitch
    WEnd

    [/autoit]
  • Danke an

    Raupi und RR04!

    Beide Skripte sind prima da lernt man wieder was neues dazu.

    Ich werde nun auch diese Skripte umsetzen mit andere Programme damit ich es auch da beherrsche wie z.B

    Autoplay Media Studio
    Setup Factory
    INNO
    Flash Prof.
    Blender

    Tausend Dank noch mal!

    MfG

    Baron