[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'ColorBox' (#lcl)

# TCustomColorBox.PickCustomColor

Selects a custom color using a color dialog.

## Declaration

Source position: colorbox.pas line 78

`protected function TCustomColorBox.PickCustomColor: Boolean; virtual;`

## Function result

True when a custom color was selected in the method.

## Description

PickCustomColor is a Boolean function used to select a custom color rather than one of the standard colors in the Colors property.

PickCustomColor is used when cbCustomColor is included in the Style for the control and ItemIndex is set to 0. This position was reserved for a custom color when the list of colors was loaded for the Style settings in the control.

PickCustomColor uses an existing value in ColorDialog when assigned, or creates the ColorDialog when needed. It executes the ColorDialog to get the color selection for the control. The custom color selection is stored as the first TColor value in the Items for the control. When a color is successfully selected using the dialog, the return value is set to True and the control is redrawn.

The color selection dialog is not displayed at design-time, and the return value is always set to False.

## See also

TCustomColorBox.Style |  | Settings which determine the colors available in the control and their display style.
TColorBoxStyle |  | Set type used to store values from the TColorBoxStyles enumeration.