[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'StdCtrls' (#lcl)

# TCustomComboBox.AutoComplete

Positions the list box using partial text matching.

## Declaration

Source position: stdctrls.pp line 422

`public property TCustomComboBox.AutoComplete : Boolean read GetAutoComplete write SetAutoComplete default False;`

## Description

AutoComplete is a Boolean property which indicates if partial text matching is used to locate values in the Items displayed for the control. When set to True, keystrokes entered in the edit box for the control are used to locate a value in Items which begins with the entered value. The ItemIndex property is updated with the ordinal position for the matching item, or -1 if an entry is not found that starts with the partial value.

Reading the value in AutoComplete causes the AutoCompleteText property to be examined, and returns True when the value cbactEnabled is included in the auto-complete options. Assigning a value to AutoComplete causes the AutoCompleteText property to include or exclude the corresponding value as needed.

Use AutoCompleteText to enable or disable other auto-complete features and behaviors in the control.

Auto-completion related tasks are performed when the KeyUp method handles valid keystrokes for the control.

Use AutoSelect to control whether text is automatically highlighted in the edit box when a new list item is selected in the control.

## See also

TCustomComboBox.AutoCompleteText |  | Options for the behavior of the Auto-Complete feature.
TCustomComboBox.AutoSelect |  | Selects the entire content of the edit box when the control receives the focus.
TCustomComboBox.Items |  | The list of items displayed in the combo-box control.
TCustomComboBox.ItemIndex |  | The index of the currently selected item, or -1 if no item is selected.
TCustomComboBox.KeyUp |  | Handles AutoComplete and AutoSelect for the control.