Question:

Delphi form color change ?

by Guest63743  |  earlier

0 LIKES UnLike

Hi, I'd like to make a button in my program that changes the colour of the form,

currently I have:

procedure TForm1.Button5Click(Sender: TObject);

begin

tform1.color := clBtnFace;

end;

but get the error: "[Pascal Error] Unit1.pas(87): E2233 Property 'Color' inaccessible here" when i try to run it, any help appreciated.

 Tags:

   Report

1 ANSWERS


  1. Hello, I'm pretty sure this code will work....

    procedure TForm1.Button5Click(Sender: TObject);

    begin

    form1.color := clred;

    end;

    this code should change the form to red when the button is clicked.

    To change the colour just change the 'clred' to something else, I'm not sure what colours are available in Delphi, just look it up on the net.

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.