# Function Reference

# _GUICtrlComboBox_LimitText

Limits the length of the text the user may type into the edit control of a ComboBox

#include <GuiComboBox.au3>
_GUICtrlComboBox_LimitText ( $hWnd [, $iLimit = 0] )

## Parameters

$hWnd | Control ID/Handle to the control
$iLimit | [optional] limit length of the text

## Return Value

None.

## Remarks

If the $iLimit parameter is zero, the text length is limited to 0x7FFFFFFE characters.
If the ComboBox does not have the $CBS_AUTOHSCROLL style, setting the text limit to be larger than the size of the edit control has no effect.
The _GUICtrlComboBox_LimitText() function limits only the text the user can enter.
It has no effect on any text already in the edit control when the message is sent, nor does it affect the length of the text copied to the edit control when a string in the ListBox is selected.
The default limit to the text a user can enter in the edit control is 30,000 characters.

## Example

    #include <GuiComboBox.au3>
    #include <GUIConstantsEx.au3>

    Example()

    Func Example()
        Local $idCombo

        ; Create GUI
        GUICreate("ComboBox Limit Text", 400, 296)
        $idCombo = GUICtrlCreateCombo("", 2, 2, 396, 296)
        GUISetState(@SW_SHOW)

        ; Limit text in edit box
        _GUICtrlComboBox_LimitText($idCombo, 10)

        ; Add files
        _GUICtrlComboBox_BeginUpdate($idCombo)
        _GUICtrlComboBox_AddDir($idCombo, @WindowsDir & "\*.exe")
        _GUICtrlComboBox_EndUpdate($idCombo)

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