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

# TCustomComboBox.SelectItem

Selects the list item with the specified text.

## Declaration

Source position: stdctrls.pp line 391

`protected function TCustomComboBox.SelectItem(`
`const AnItem: string`
`):Boolean;`

## Arguments

`AnItem` |  | The text to find in Items.

## Function result

True when a matching item was found and selected.

## Description

SelectItem is a Boolean function used to select the list item in the control with the value specified in AnItem. The return value is True when the Items property contains an entry with the value in AnItem.

The value in ItemIndex is updated with the ordinal position in Items for the specified value, or -1 when AnItem does not exist in Items. When the value in ItemIndex is changed, the Click and Select methods are called to refresh the control display and to signal the OnClick and OnSelect event handlers.

## See also

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.Select |  | Signals the OnSelect event handler when ItemIndex is changed.
TCustomComboBox.OnSelect |  | Handler invoked when an item is selected.
TControl.Click |  | Signals OnClick and/or executes the ActionLink when the control has been clicked.
TControl.OnClick |  | Notification handler for mouse clicks.