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

TCustomColorListBox.PickCustomColor

Selects a custom color using a color dialog.

Declaration

Source position: colorbox.pas line 201

protected function TCustomColorListBox.PickCustomColor: Boolean; virtual;

Function result

True when a custom color was selected in the color dialog.

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 available, or creates and executes a TColorDialog 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.


Version 3.2 Generated 2024-02-25 Home