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

# TComboExItems.AddItem

Adds a new item with the specified values to the collection.

## Declaration

Source position: comboex.pas line 128

`public function TComboExItems.AddItem(`
`const ACaption: string;`
`AImageIndex: SmallInt = - 1;`
`AOverlayImageIndex: SmallInt = - 1;`
`ASelectedImageIndex: SmallInt = - 1;`
`AIndent: SmallInt = - 1;`
`AData: TCustomData = Nil`
`):TComboExItem;`

## Arguments

`ACaption` |  | Caption for the item.
`AImageIndex` |  | Image index for the item.
`AOverlayImageIndex` |  | Overlay image index for the item.
`ASelectedImageIndex` |  | Selected image index for the item.
`AIndent` |  | Indent spacing for the item.
`AData` |  | Pointer to the arbitrary data associated with the item.

## Function result

Item added to the collection.

## Description

AddItem is a TComboExItem function used to add a new item to the collection with the values specified in the parameters passed to the method. AddItem calls the Add method to create a new TComboExItem instance. The following properties are updated in the collection item to use the values specified in the arguments:

- Caption
- indent
- ImageIndex
- OverlayImageIndex
- SelectedImageIndex
- Data

## See also

TComboExItems.Add |  | Adds a new item to the collection.
TComboExItem.Indent |  | Space reserved between the Image and the caption for the item.
TComboExItem.OverlayImageIndex |  | Ordinal position for the image drawn as an overlay for the Image in the combo-box item.
TComboExItem.SelectedImageIndex |  | Ordinal position for the image drawn when the item is selected in the Combo-Box.
TListControlItem.Data |  | Pointer to the data used in custom sort operations.
TListControlItem.Caption |  | Text displayed for the collection item.
TListControlItem.ImageIndex |  | Ordinal position for the image displayed for the collection item.