Function _GUICtrlComboBoxEx_LimitText

Function Reference


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

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


$hWnd Handle to the control
$iLimit [optional] Limit length of the text

Return Value



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.


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


Func Example()
    Local $hGUI, $hCombo

    ; Create GUI
    $hGUI = GUICreate("ComboBoxEx Limit Text", 400, 300)
    $hCombo = _GUICtrlComboBoxEx_Create($hGUI, "", 2, 2, 394, 100)

    ; Add files
    _GUICtrlComboBoxEx_AddDir($hCombo, "", $DDL_DRIVES, False)
    _GUICtrlComboBoxEx_AddDir($hCombo, "", $DDL_DRIVES)
    _GUICtrlComboBoxEx_AddDir($hCombo, @WindowsDir & "\*.exe")

    ; Limit Text in Edit control
    _GUICtrlComboBoxEx_LimitText($hCombo, 10)

    Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc   ;==>Example