# Function Reference

# _GUICtrlEdit_InsertText

Insert text

#include <GuiEdit.au3>
_GUICtrlEdit_InsertText ( $hWnd, $sText [, $iIndex = -1] )

## Parameters

$hWnd | Control ID/Handle to the control
$sText | String to insert
$iIndex | [optional] Character position to insert

## Return Value

None.

## Related

_GUICtrlEdit_AppendText

## Example

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

    Example()

    Func Example()
        Local $idEdit
        Local $sWow64 = ""
        If @AutoItX64 Then $sWow64 = "\Wow6432Node"
        Local $sFile = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE" & $sWow64 & "\AutoIt v3\AutoIt", "InstallDir") & "\include\_ReadMe_.txt"

        ; Create GUI
        GUICreate("Edit Insert Text", 400, 300)
        $idEdit = GUICtrlCreateEdit("", 2, 2, 394, 268, BitOR($ES_WANTRETURN, $WS_VSCROLL))
        GUISetState(@SW_SHOW)

        ; Set Margins
        _GUICtrlEdit_SetMargins($idEdit, BitOR($EC_LEFTMARGIN, $EC_RIGHTMARGIN), 10, 10)

        ; Set Text
        _GUICtrlEdit_SetText($idEdit, FileRead($sFile))

        ; Insert text
        _GUICtrlEdit_InsertText($idEdit, "*** Excellent UDFs ***" & @CRLF & @CRLF, 0)

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