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

# TCustomComboBoxEx.Add

Adds a new item to the extended combo-box control.

## Declaration

Source position: comboex.pas line 164

`public function TCustomComboBoxEx.Add: Integer; overload; procedure TCustomComboBoxEx.Add(`
`const ACaption: string;`
`AIndent: Integer = - 1;`
`AImgIdx: TImageIndex = - 1;`
`AOverlayImgIdx: TImageIndex = - 1;`
`ASelectedImgIdx: TImageIndex = - 1`
`); overload;`

## Function result

Item added to the control.

## Arguments

`ACaption` |  | Caption for the added item.
`AIndent` |  | Indent for the added item.
`AImgIdx` |  | Image index for the added item.
`AOverlayImgIdx` |  | Overlay image index for the added item.
`ASelectedImgIdx` |  | Select image index for the added item.

## Description

Add is an overloaded method used to add a new item to the extended combo-box control. Both procedure and function variants are provided.

The function variant accepts no arguments, and returns an Integer value with the ordinal position in ItemsEx where the new item was inserted. The caption for the new item is set to the TComboExItem.cDefCaption constant.

The procedure variant does not return the new position for the inserted item. Use the Count property in ItemsEx to determine the ordinal position for the item on exit from the method. Use the parameters to specify the values stored in the corresponding properties in the TComboExItem class instance.