Function Reference


_GUICtrlEdit_GetText

Get the text from the edit control

#include <GuiEdit.au3>
_GUICtrlEdit_GetText($hWnd)

Parameters

$hWnd Control ID/Handle to the control

Return Value

Success: String from the edit control
Failure: Empty string

Remarks

None.

Related

_GUICtrlEdit_SetText, _GUICtrlEdit_AppendText, _GUICtrlEdit_GetTextLen

Example


#include <GuiEdit.au3>
#include <GUIConstantsEx.au3>

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

_Main()

Func _Main()
    Local $hEdit

    ; Create GUI
    GUICreate("Edit Get Text", 400, 300)
    $hEdit = GUICtrlCreateEdit("", 2, 2, 394, 268)
    GUISetState()

    ; Set Text
    _GUICtrlEdit_SetText($hEdit, "This is a test" & @CRLF & "Another Line" & @CRLF & "Append to the end?")

    ; Get Text
    MsgBox(4160, "Information", _GUICtrlEdit_GetText($hEdit))

    ; Loop until user exits
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()
EndFunc   ;==>_Main