unit2.pas

来自「本光盘是《Delphi 7应用教程》一书的配套光盘」· PAS 代码 · 共 54 行

PAS
54
字号
unit Unit2;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm2 = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Button1: TButton;
    Button2: TButton;
    procedure FormShow(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation

uses Unit1;

{$R *.dfm}

procedure TForm2.FormShow(Sender: TObject);
begin
   Label1.Caption :='您的姓名是:'+Form1.Edit1.text;
   Label2.Caption :='您购卖的商品是:'+Form1.Edit2.text;
   Label3.Caption :='您购买的商品数量是:'+Form1.Edit3.Text ;
end;

procedure TForm2.Button1Click(Sender: TObject);
begin
  Form2.Close ;
  Form1.Close ;
end;

procedure TForm2.Button2Click(Sender: TObject);
begin
  Form2.Hide;
  Form1.Show;
end;

end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?