90版本天帝时装上衣:请问!delphi的form1按钮激发另一窗体form2时,为什么失败?

来源:百度文库 编辑:高考问答 时间:2024/05/06 08:37:56
请问!我在用delphi的form1按钮事件激发另一窗体form2时,为什么form1消失后form2不会出现呢?

form1的代码如下:

unit Unit1;

interface

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

type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
form2.show;
form1.close;
end;

end.

请帮帮忙!先谢了!!