Sign in Join
FPDoc Onlineexperiment

TCustomColorBox.PickCustomColor function

Member of TCustomColorBoxprotectedIn unit ColorBox

Selects a custom color using a color dialog.

Declaration

pascal
function PickCustomColor: Boolean; virtual

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

An experiment, built from Lazarus main 2dfa93c66e of 10-22-2026. Not the official Lazarus documentation.