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

# TCustomComboBoxEx.AddItem

Adds the specified item and object instance to the control.

## Declaration

Source position: comboex.pas line 168

`public procedure TCustomComboBoxEx.AddItem(`
`const Item: string;`
`AnObject: TObject`
`); override;`

## Arguments

`Item` |  | Item added to the control.
`AnObject` |  | Object with data for the item added to the control.

## Description

AddItem is a procedure used to create a new item in the extended combo-box control with the specified caption and object data. Item contains the caption assigned to the new TComboExItem instance. AnObject is an object with the data stored in the new TComboExItem instance.

AddItem calls Insert to create, update, and store the item in the ItemsEx property. The value in AnObject is stored to the Data property in the extended combo-box item appended to ItemsEx.

## See also

TCustomComboBoxEx.ItemsEx |  | Collection with the extended items defined for the control.
TListControlItem.Caption |  | Text displayed for the collection item.
TListControlItem.Data |  | Pointer to the data used in custom sort operations.
TComboExItems |  | Implements a collection for the items added to TCustomComboBoxEx.
TComboExItem |  | Implements an extended item used in TComboEx.
TListControlItems |  | Container for the items added to a list control.