unit Unit1;
….
….
procedure TForm1.FormCreate(Sender: TObject);
begin
if Application.FindComponent('Form2')=nil then
Application.CreateForm(TForm2,Form2);
Form2.Show;
end;procedure TForm1.Button1Click(Sender: TObject);
begin
Close;
end;unit Unit2;
….
….
procedure TForm2.Timer1Timer(Sender: TObject);
begin
Timer1.Enabled:=False;
Form1.Visible:=True;
Form2.Free;
end;
为什么FORM2释放后,出现FORM1,这是关闭FORM1无法完全关闭程序,只是暂停,这是为什么?
如果执行EXE文件,关闭程序时也无法关闭,进程中还有此进程!!!
请各位高手帮忙分析以下,不胜感激!!!
….
….
procedure TForm1.FormCreate(Sender: TObject);
begin
if Application.FindComponent('Form2')=nil then
Application.CreateForm(TForm2,Form2);
Form2.Show;
end;procedure TForm1.Button1Click(Sender: TObject);
begin
Close;
end;unit Unit2;
….
….
procedure TForm2.Timer1Timer(Sender: TObject);
begin
Timer1.Enabled:=False;
Form1.Visible:=True;
Form2.Free;
end;
为什么FORM2释放后,出现FORM1,这是关闭FORM1无法完全关闭程序,只是暂停,这是为什么?
如果执行EXE文件,关闭程序时也无法关闭,进程中还有此进程!!!
请各位高手帮忙分析以下,不胜感激!!!
begin
if Application.FindComponent('Form2')=nil then
Application.CreateForm(TForm2,Form2); //为什么要这样创建? 而且是在TForm1.FormCreate
Form2.Show;
end;
begin
Application.Terminate;
end;
action:=cafree;
form2:=nil;
FORMCREATE中的代码是为了实现飞屏的效果,FORM2是飞屏界面。
我已经得到答案了,谢谢各位的帮忙!!!!