dummes GUI Problem *grml*

  • hi ihr,

    hab eine GUI gemacht und er hat schon automatisch bevor ich in der GUI einen Radio checke beide Variablen initialisiert und mit Werten belegt.

    Aber seht selbst:

    [autoit]


    #include <GUIConstants.au3>
    #include <IE.au3>

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

    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Dialog", 626, 570, 334, 169)
    ;GUISetIcon("D:\009.ico")
    $GroupBox1 = GUICtrlCreateGroup("", 8, 8, 529, 553)
    $Radio1 = GUICtrlCreateRadio("CY", 8, 8, 89, 25)
    $Radio2 = GUICtrlCreateRadio("CZ", 8, 40, 89, 25)
    $Radio3 = GUICtrlCreateRadio("DE", 8, 72, 89, 25)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Button1 = GUICtrlCreateButton("OK", 544, 8, 75, 25, 0)
    $Button2 = GUICtrlCreateButton("Cancel", 544, 40, 75, 25, 0)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $nMsg = $Radio1
    $user="a"
    $pw="aa"
    MsgBox(0,"test","user:"&$user&" pw:"&$pw)
    Case $nMsg = $Radio2
    $user="b"
    $pw="bb"
    Case $nMsg = $Radio3
    $user="c"
    $pw="cc"
    Case $nMsg = $Button1
    login()
    Case $nMsg = $Button2
    Exit
    EndSwitch
    WEnd

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

    func login()
    $o_IE1 = _IECreate ("testhomepage")
    _IELoadWait($o_IE1)
    Send("{TAB 2}")
    Send($user)
    Send("{TAB}")
    Send($pw)
    Send("{TAB}")
    Send("{ENTER}")
    endfunc

    [/autoit]

    es is eigentlich ein einfaches loginGUI fürne Firmeninterne Page die 30 user und pws enthält - und ich will nicht immer in meinen Unterlagen danach kramen *gg*.

    Also das problem liegt irgendwo in der while schleife nur wo wie und warum :hammer:

    • Offizieller Beitrag

    Hi,

    Spoiler anzeigen
    [autoit][/autoit] [autoit][/autoit] [autoit]

    #include <GUIConstants.au3>
    #include <IE.au3>

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

    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Dialog", 626, 570, 334, 169)
    ;GUISetIcon("D:\009.ico")
    $GroupBox1 = GUICtrlCreateGroup("", 8, 8, 529, 553)
    $Radio1 = GUICtrlCreateRadio("CY", 8, 8, 89, 25)
    $Radio2 = GUICtrlCreateRadio("CZ", 8, 40, 89, 25)
    $Radio3 = GUICtrlCreateRadio("DE", 8, 72, 89, 25)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Button1 = GUICtrlCreateButton("OK", 544, 8, 75, 25, 0)
    $Button2 = GUICtrlCreateButton("Cancel", 544, 40, 75, 25, 0)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    Switch GUIGetMsg()
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    login()
    Case $Button2
    Exit
    EndSwitch
    WEnd

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

    Func login()
    If GUICtrlRead($Radio1) = $GUi_Checked Then
    $user = "a"
    $pw = "aa"
    ElseIf GUICtrlRead($Radio2) = $GUi_Checked Then
    $user = "b"
    $pw = "bb"
    ElseIf GUICtrlRead($Radio3) = $GUi_Checked Then
    $user = "c"
    $pw = "cc"
    EndIf
    MsgBox(64, "Info", $user & " " & $pw)
    $o_IE1 = _IECreate("testhomepage")
    _IELoadWait($o_IE1)
    Send("{TAB 2}")
    Send($user)
    Send("{TAB}")
    Send($pw)
    Send("{TAB}")
    Send("{ENTER}")
    EndFunc ;==>login

    [/autoit]

    So long,

    Mega