unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Button3: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(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.Height := form1.Height + 10; //窗口高度加10
form1.Width := form1.Width + 10; //窗口宽度加10
end;
procedure TForm1.Button2Click(Sender: TObject); //单击“窗口缩小”按钮,窗口将缩小
begin
form1.Height := form1.Height - 10; //窗口高度减10
form1.Width := form1.Width - 10; //窗口宽度减10
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
close; //退出
end;
end.