B
bluesky1000
Unregistered / Unconfirmed
GUEST, unregistred user!
各位大大,我是个菜鸟,有一问题请教。
我做了一个程序。程序中有5个FORM和1个ABOUTBOX,程序做完后,想将FORM6做成启动窗口,
效果应该是FORM6出现7秒后,关闭,然后FORM1(主程序)启动。可我做了半天没个结果,代码
如下:
program Project1;
uses
Forms,
Unit1 in 'Unit1.pas' {Form1},
Unit2 in 'Unit2.pas' {Form2},
Unit3 in 'Unit3.pas' {Form3},
Unit4 in 'Unit4.pas' {Form4},
Unit5 in 'Unit5.pas' {AboutBox},
Unit6 in 'Unit6.pas' {Form6};
{$R *.res}
begin
Application.Initialize;
Application.CreateForm(TForm6, Form6);
form6.Show;
form6.Update;
form6.Close;
Application.CreateForm(TForm1, Form1);
Application.CreateForm(TForm2, Form2);
Application.CreateForm(TForm3, Form3);
Application.CreateForm(TForm4, Form4);
Application.CreateForm(TAboutBox, AboutBox);
Application.Run;
end.
{然后在FORM6的onclose事件中加入以下代码:}
procedure TForm1.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
sleep(7000);
end;
可运行的结果是:FORM6如愿的出来了,但后面的FORM1(主程序)却出不来了,请问我的代码有错吗?
大大有何解决办法?
我做了一个程序。程序中有5个FORM和1个ABOUTBOX,程序做完后,想将FORM6做成启动窗口,
效果应该是FORM6出现7秒后,关闭,然后FORM1(主程序)启动。可我做了半天没个结果,代码
如下:
program Project1;
uses
Forms,
Unit1 in 'Unit1.pas' {Form1},
Unit2 in 'Unit2.pas' {Form2},
Unit3 in 'Unit3.pas' {Form3},
Unit4 in 'Unit4.pas' {Form4},
Unit5 in 'Unit5.pas' {AboutBox},
Unit6 in 'Unit6.pas' {Form6};
{$R *.res}
begin
Application.Initialize;
Application.CreateForm(TForm6, Form6);
form6.Show;
form6.Update;
form6.Close;
Application.CreateForm(TForm1, Form1);
Application.CreateForm(TForm2, Form2);
Application.CreateForm(TForm3, Form3);
Application.CreateForm(TForm4, Form4);
Application.CreateForm(TAboutBox, AboutBox);
Application.Run;
end.
{然后在FORM6的onclose事件中加入以下代码:}
procedure TForm1.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
sleep(7000);
end;
可运行的结果是:FORM6如愿的出来了,但后面的FORM1(主程序)却出不来了,请问我的代码有错吗?
大大有何解决办法?