# Function Reference

# _GUICtrlEdit_GetLimitText

Gets the current text limit for an edit control

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

## Parameters

$hWnd | Control ID/Handle to the control

## Return Value

Returns the text limit.

## Remarks

The text limit is the maximum amount of text, in TCHARs, that the control can contain.
For ANSI text, this is the number of bytes; for Unicode text, this is the number of characters.
Two documents with the same character limit will yield the same text limit, even if one is ANSI and the other is Unicode.

## Related

_GUICtrlEdit_SetLimitText

## Example

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

    Example()

    Func Example()
        ; Create GUI
        GUICreate("Edit Get/Set Limit Text (v" & @AutoItVersion & ")", 400, 300)
        Local $idEdit = GUICtrlCreateEdit("This is a test" & @CRLF & "Another Line", 2, 2, 394, 268)
        GUISetState(@SW_SHOW)

        MsgBox($MB_SYSTEMMODAL, "Information", "Text Limit: " & _GUICtrlEdit_GetLimitText($idEdit))

        MsgBox($MB_SYSTEMMODAL, "Information", "Setting Text Limit")
        _GUICtrlEdit_SetLimitText($idEdit, 64000)

        MsgBox($MB_SYSTEMMODAL, "Information", "Text Limit: " & _GUICtrlEdit_GetLimitText($idEdit))

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