TColorPicker (Object Pascal)

From Appmethod Code Examples
Jump to: navigation, search

Description

1. Select File > New > Multi-Device Application-Object Pascal.

2. Add from the Tool Palette to your form:

3. Select the TColorPicker.

1. In the Object Inspector set the ColorQuad option to ColorQuad1.
2. Drag the corners or sides of the TColorPicker so that it is tall vertically and narrow horizontally (the opposite of the desired orientation).
3. Set the RotationAngle from the Object Inspector to 90.

4. Select ColorBox2 in the ColorBox option from the Object Inspector.

5. Select the TColorPicker and expand the ColorQuad option from the Events tab. Double-click the OnChange event handler and enter the following code:

Code

procedure TForm2.ColorQuad1Change(Sender: TObject);
begin
  ColorBox1.Color:=ColorPicker1.Color;
  ColorBox2.Color:=ColorQuad1.ColorBox.Color;
end;

Uses

See Also