Focus auf Button setzen wenn ein Inputfeld befüllt wurde

  • Hallo Gemeinde,

    kann man den Focus auf einen Button setzen, nachdem in einem Input etwas eingetragen wurde?

    Die GUI hat drei Radiobuttons das Inputfeld und einen Button zum Auslösen der Aktion. Der User Muss zuerst eins der Radioboxen auswählen, dann eine Zahl in ein Inpufeld eintragen.

    Ich hätte gern, dass nach dem Eintrag der Zahl in das Inputfeld, der Button den Focus bekommt, sodass der User einfach nur enter drücken muss und damit die hinterlegte Funktion gestartet wird.

    Spoiler anzeigen

    #Region ### START Koda GUI section ### Form=

    $Form1_1 = GUICreate("UrlGenerator", 617, 315, 182, 162)

    $Radio1 = GUICtrlCreateRadio("regal1", 127, 32, 113, 25)

    $Radio2 = GUICtrlCreateRadio("regal2", 283, 32, 81, 25)

    $Radio3 = GUICtrlCreateRadio("REgal3", 439, 32, 49, 25)

    $Portname = GUICtrlCreateInput("", 218, 128, 185, 21)

    $Button1 = GUICtrlCreateButton("Open Url", 251, 224, 113, 41)

    $Portname = GUICtrlCreateLabel("Portname:", 221, 111, 67, 17)

    GUISetState(@SW_SHOW)

    #EndRegion ### END Koda GUI section ###

    While 1

    $nMsg = GUIGetMsg()

    Switch $nMsg

    Case $GUI_EVENT_CLOSE

    Exit

    Case $Button1

    $s_Portname = GUICtrlRead($Portname)

    If $s_Portname = "" Then

    MsgBox(0, 'Error', "devicename or protnumber entry are missing")

    EndIf

    $s_radiobox = GUICtrlRead($Radio1)

    If $s_radiobox = 1 Then

    $idMsg = "Radio1"

    GenerateUrl($idMsg)

    Else

    $s_radiobox = GUICtrlRead($Radio2)

    If $s_radiobox = 1 Then

    $idMsg = "Radio2"

    GenerateUrl($idMsg)

    Else

    $s_radiobox = GUICtrlRead($Radio3)

    If $s_radiobox = 1 Then

    $idMsg = "Radio3"

    GenerateUrl($idMsg)

    Else

    MsgBox(0, 'Error', "There is no Radiobox checked!!!")

    EndIf

    EndIf

    EndIf


    EndSwitch

    WEnd