unit five;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
ChangeColor: TButton;
procedure ChangeColorClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;
implementation{$R *.dfm}procedure TForm1.ChangeColorClick(Sender: TObject);
begin
if ColorDialog1.Execute then
Form1.Color:=ColorDialog1.Color;
else
Form1.Color:=clRed;
end;end.
这要怎么改才能正常运行啊?刚在学DELPHI..
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
ChangeColor: TButton;
procedure ChangeColorClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;
implementation{$R *.dfm}procedure TForm1.ChangeColorClick(Sender: TObject);
begin
if ColorDialog1.Execute then
Form1.Color:=ColorDialog1.Color;
else
Form1.Color:=clRed;
end;end.
这要怎么改才能正常运行啊?刚在学DELPHI..
Form1.Color:=ColorDialog1.Color //不用分号
else
Form1.Color:=clRed;
'then'expected but identifier :'Execute' found
statement expected but end of file found