Function Reference


_GUICtrlIpAddress_SetArray

Sets the address in the IP address control

#include <GuiIPAddress.au3>
_GUICtrlIpAddress_SetArray ( $hWnd, $aAddress )

Parameters

$hWnd Handle to the control
$aAddress Array formatted as follows:
[0] - 1st address field
[1] - 2nd address field
[2] - 3rd address field
[3] - 4th address field

Return Value

None.

Related

_GUICtrlIpAddress_GetArray

Example

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

Global $g_idMemo

Example()

Func Example()

        Local $hGui = GUICreate("IP Address Control Get/Set Array (v" & @AutoItVersion & ")", 400, 300)
        Local $hIPAddress = _GUICtrlIpAddress_Create($hGui, 2, 4, 125, 20)
        $g_idMemo = GUICtrlCreateEdit("", 2, 28, 396, 270, 0)
        GUICtrlSetFont($g_idMemo, 9, 400, 0, "Courier New")
        GUISetState(@SW_SHOW)

        Local $aIP[4] = [24, 168, 2, 128]
        _GUICtrlIpAddress_SetArray($hIPAddress, $aIP)

        $aIP = _GUICtrlIpAddress_GetArray($hIPAddress)

        MemoWrite("Field 1 .....: " & $aIP[0])
        MemoWrite("Field 2 .....: " & $aIP[1])
        MemoWrite("Field 3 .....: " & $aIP[2])
        MemoWrite("Field 4 .....: " & $aIP[3])

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

; Write a line to the memo control
Func MemoWrite($sMessage)
        GUICtrlSetData($g_idMemo, $sMessage & @CRLF, 1)
EndFunc   ;==>MemoWrite