使用 GUICtrlSetState (控件ID, $GUI_FOCUS) 可以将输入焦点调到该控件上#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("Form1", 617, 319, 192, 132)
$Input1 = GUICtrlCreateInput("Input1", 48, 24, 145, 24)
$Input2 = GUICtrlCreateInput("Input2", 232, 24, 177, 24)
$Input3 = GUICtrlCreateInput("Input3", 448, 24, 129, 24)
$Button1 = GUICtrlCreateButton("Button1", 176, 160, 113, 33)
GUISetState(@SW_SHOW)
AdlibRegister("aa", 500)
$i = 1
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func aa()
If $i > 3 Then $i = 1
GUICtrlSetState(Eval("Input" & $i), $GUI_FOCUS)
$i += 1
EndFunc
|