Function Reference


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] )


$hWnd Control ID/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 <GuiComboBox.au3>
#include <GUIConstantsEx.au3>


Func Example()
    Local $idCombo

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

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

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

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