Skip to main content

TcxListBox.AddItem(string,TObject) Method

Adds a new item to the list box control.

Declaration

procedure AddItem(AItem: string; AObject: TObject);

Parameters

Name Type
AItem string
AObject TObject

Remarks

Use the AddItem method to add a new item to the list. The AItem parameter represents the caption of the added item. The AObject parameter can contain any data associated with it.

If the list is not sorted (the Sorted property value is False), the item is added to the end of the collection. Otherwise, it is inserted to the appropriate place that preserves the sort order.

Note

this method is not in effect when the list box is in virtual mode. The current mode is specified by the ListStyle property.

See Also