The Color Dialogue

The Color Dialog allows the colour of objects in controls to be set from a dialog. For example:

In this example a toolbar has been added from the Win32 palette. The button has been added by right-clicking the toolbar and choosing 'New Button'. The image was added to the button by including an ImageList control and setting the toolbar's Images property to this list.

The code:

procedure TForm1.ToolButton1Click(Sender: TObject);
begin
 if ColorDialog1.Execute then
 begin
  richedit1.font.Color:=colordialog1.Color;
 end;
end;

Back to Palette List