函数参考


_GUICtrlIpAddress_SetRange

设置 IP 地址指定字段的有效范围

#Include <GuiIPAddress.au3>
_GUICtrlIpAddress_SetRange($hWnd, $iIndex[, $iLowRange = 0[, $iHighRange = 255]])

参数

$hWnd 控件句柄
$iIndex 字段的 0 基索引
$iLowRange [可选参数] 范围的下限
$iHighRange [可选参数] 范围的上限

返回值

成功: 返回 True
失败: 返回 False

注意/说明

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 Range Example", 300, 150)
    $hIPAddress = _GUICtrlIpAddress_Create($hgui, 10, 10)
    GUISetState(@SW_SHOW)

    _GUICtrlIpAddress_Set($hIPAddress, "24.168.2.128")

    ; set range on 1st field
    _GUICtrlIpAddress_SetRange($hIPAddress, 0, 198, 200)

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