我D7里没问题呀
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,Unit2, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
form2 : Tform2 ;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
Form2:=TForm2.Create(self);
Form2.Hide;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
form2.Show ;
end;
end.
不知道为你在hide之前,要show一下,这样做让人看到窗体闪一下很不好的。