Skip to main content

TcxColorComboBoxItems.InsertColor(Integer,TColor,string) Method

Inserts an item with the specified color and description within the collection.

Declaration

function InsertColor(Index: Integer; const AColor: TColor; const ADescription: string): TcxColorComboBoxItem; virtual;

Parameters

Name Type
Index Integer
AColor TColor
ADescription string

Returns

Type
TcxColorComboBoxItem

Remarks

Use the InsertColor method to insert a new item in the collection at a specified position. The position of the inserted item is specified by the Index parameter. If this parameter value is negative or exceeds the maximum available item position, an exception is raised. The maximum available item position is specified by the Count property of the collection. If the Index parameter value is the same as the value of this property, the item is added to the end of the collection. Note that items can also be added to the end of the collection using the AddColor method.

The AColor parameter specifies the color represented by the inserted item and the ADescription parameter provides its textual description. These values are assigned to the inserted item’s Color and Description properties, respectively.

If the AColor color item already exists within the list, the method does nothing and returns nil. Otherwise, it returns a reference to the inserted item.

See Also