第一次上Delphi感觉还是不错的,就是自己的英文太差了,里面的很多控件都不认识。
初次上机 自己胡乱写了一个可以改变窗体背景色程序。
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Button4: TButton;
Button5: TButton;
Button6: TButton;
Button3: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure Button6Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
form1.Caption:='红色背景'; //窗口标题
form1.Color:=clred //窗体颜色改变
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
form1.Caption:='白色背景';
form1.Color:=clwhite
end;
procedure TForm1.Button4Click(Sender: TObject);
begin
form1.Caption:='蓝色背景';
form1.Color:=clblue
end;
procedure TForm1.Button5Click(Sender: TObject);
begin
form1.Caption:='黄色背景';
form1.Color:=clyellow
end;
procedure TForm1.Button6Click(Sender: TObject);
begin
form1.Caption:='绿色背景';
form1.Color:=clgreen
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
form1.Close
end;
end.
第一次用它编了个小代码,心里还是挺高兴的。