Noob-Frage - Switchcase & AND-Bedingung

  • Hi, heut ist mein erster AutoIT Tag und ich stehe vor folgendem Problem: Hab mir eine GUI gebaut mit Radiobuttons und einem OK-Button. Nun möchte ich, dass er bei Aktiviertem Radio1 beim Drücken von OK, ein programm1 ausführt, bei Radio2 das programm2 usw.

    Wie kriege ich in meinem Switch (oder Select?!?) hin, dass er nicht nur den OK-Button abfragt sondern auch den Radio-Button.

    Habe es bis jetzt so:

    #include <GUIConstants.au3>

    GUICreate("Service-Skript V1.0",700,200)
    GUISetState(@sw_show)

    $text1=GUICtrlCreateLabel("Bitte wählen Sie eines der folgenden Programme aus, in dem Sie den entsprechenden Button auswählen und mit OK bestätigen. Zum Beenden des Programms, bitte Exit wählen.",15,10,200,80,-1,-1)
    $button_ok=GUICtrlCreateButton("OK",240,50,200,35,-1,-1)
    $button_exit=GUICtrlCreateButton("Exit",470,50,200,35,-1,-1)
    GUIStartGroup()
    $radio_1 = GUICtrlCreateRadio ("Programm 1", 240, 100, 200, 20)
    $radio_2 = GUICtrlCreateRadio ("Programm 2", 240, 120, 200, 20)
    $radio_3 = GUICtrlCreateRadio ("Programm 3", 240, 140, 200, 20)
    GUICtrlSetState($radio_1, $GUI_checked)

    ; Init our vars that we will use to keep track of GUI events
    $radioval1 = 0 ; We will assume 0 = first radio button selected, 4 = last button
    $radioval2 = 2
    $radioval3 = 4

    ; Show the GUI
    GUISetState ()

    ; In this message loop we use variables to keep track of changes to the radios, another
    ; way would be to use GUICtrlRead() at the end to read in the state of each control
    While 1
    $msg = GUIGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
    Exit
    Case $msg = $button_exit
    Exit
    Case $msg = $button_ok AND $radio_1=$GUI_Checked
    run ('programm1')
    Case $msg = $radio_1 AND $msg <= $radio_3
    $radioval1 = $msg - $radio_1

    EndSelect
    WEnd

    Einmal editiert, zuletzt von greetzz (24. November 2006 um 14:30)

  • Danke für die schnelle, und EINFACHE Hife *ggg*

    Einmal editiert, zuletzt von greetzz (24. November 2006 um 15:18)