Skip to main content

TcxCustomColorComboBoxProperties.Items Property

Provides access to the list of items displayed within the color combo box.

Declaration

property Items: TcxColorComboBoxItems read; write;

Property Value

Type
TcxColorComboBoxItems

Remarks

Initially, the collection of items represented by the Items property is populated with standard Delphi colors. There are three ways to populate this collection with items (i.e. display items within the control):

  1. Add items to the collection manually at runtime. At design time, adding items to the CustomColors collection results in these items being added to the Items collection when the color combo box is initialized.

  2. Set the PrepareList property or call the PrepareDelphiColorList, PrepareHTML4ColorList, PrepareX11ColorList or PrepareX11OrderedColorList method at runtime. This populates the combo box with a predefined set of items.

  3. Set the NamingConvention property to a value different from cxncNone at design time and leave the Items collection empty. In this instance, the combo box will be populated with a predefined set of items at application startup.

Note that the last alternative uses one of the methods listed in the second to perform its task. Thus, these two approaches are almost the same.

Note

Set the AllowSelectColor property to True to let end-users add custom colors to the list at runtime. You can specify whether each selected color should be added to the list by handling the OnSelectCustomColor event.

All the items added to the Items collection either by you (at design time or programmatically) or by end-users can be accessed via the CustomColors property.

The Items property is represented by the TcxColorComboBoxItems object, a TCollection descendant. You can use the properties and methods of this object to traverse through items and manage the list. Please refer to the TcxColorComboBoxItems class description for details.

See Also