Skip to main content

TcxCustomColorComboBoxProperties.OnGetDefaultColor Event

Enables you to specify the color used to populate the color box when none of its items are selected.

Declaration

property OnGetDefaultColor: TcxGetDefaultColorEvent read; write;

Remarks

The DefaultColorStyle property lets you define the appearance of the color combo box when none of its items are selected. If this property is set to cxdcCustom, the color box and the default description string are displayed by the control. You can modify this color using the OnGetDefaultColor event handler. To specify color, assign the proper value to the AColor parameter. The Sender parameter enables you to identify the color combo box that raised the event.

The OnGetDefaultColor event must be handled if you want to provide different colors for the unspecified state of the combo box depending upon specific external condition, e.g. the color of another control on the form. In this instance, you can assign the current color of that control to the AColor parameter and the color combo will display the correct control’s color regardless of whether any item is selected.

If the unspecified state of the color combo box needs the same color as the color box, set the DefaultColorStyle property to cxdcColor and assign the desired color to the DefaultColor property.

See Also