Monday, March 3, 2014

TColorDialog example

For this tutorial add a button from standard tab and a TColorDialog from Dialogs tab  in the form.
Change the caption of button1 to "form1 color"

double click the button and write the following code

Procedure TForm1.Button1Click( Sender: TObject );
 begin
   if colordialog1.Execute then
    form1.Color:=(colordialog1.Color);
 end;


This code executes the colordialog1 if we run the program and press the button.



 If we select for example blue color form1 became blue.

Thats all..



No comments:

Post a Comment