Skip to main content

TcxColorComboBoxItems.FindColorItem(TColor) Method

Returns an item representing a specified color.

Declaration

function FindColorItem(const AColor: TColor): TcxColorComboBoxItem; virtual;

Parameters

Name Type
AColor TColor

Returns

Type
TcxColorComboBoxItem

Remarks

Use the FindColorItem method to obtain the combo box item representing a specified color. The color is specified by the AColor parameter. If the specified color is not assigned to the Color property of any item, the method returns nil. Otherwise, it returns a reference to the TcxColorComboBoxItem object representing the item.

The FindColorItem method is useful if you want direct access to the item representing the specified color. For instance, you may want to change the description of the black color item. The code below allows you to do this.

var Item: TcxColorComboBoxItem;
// ...
Item := cxColorComboBox1.Properties.Items.FindColorItem(clBlack);
Item.Description := 'Black color description';
See Also