函数参考


_GUICtrlIpAddress_SetFocus

设置键盘焦点到IP地址控件中指定的字段.

#Include <GuiIPAddress.au3>
_GUICtrlIpAddress_SetFocus($hWnd, $iIndex)

参数

$hWnd 控件句柄
$iIndex 要设置焦点的字段索引值(基于0开始).
如果这个值超过字段的数量,
焦点将会设置到第一个空白字段,如果所有字段都是非空的,
焦点设置到第一个字段.

返回值

None.

注意/说明

None.

相关

示例/演示


#include <GUIConstantsEx.au3>
#include <GuiIPAddress.au3>

$Debug_IP = False ; Check ClassName being passed to IPAddress functions, set to True and use a handle to another control to see it work

_Main()

Func _Main()
    Local $hgui, $hIPAddress

    $hgui = GUICreate("IP Address Control Set Focus Example", 400, 300)
    $hIPAddress = _GUICtrlIpAddress_Create($hgui, 2, 4)
    GUISetState(@SW_SHOW)

    _GUICtrlIpAddress_Set($hIPAddress, "24.168.2.128")

    _GUICtrlIpAddress_SetFocus($hIPAddress, 1)
    ; Wait for user to close GUI
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc   ;==>_Main