我的splash窗口怎么了????
我之前曾问过这个问题,但我感觉没有说清楚,现叙述如下:
我给应用程序做了一个splash,但运行结果是先出现一个秃秃的空form,(一闪而过后)再出现splash图画,(5秒后)再出现主程序窗口。前两者的时间间隔很短,但我确实可以看到这个间隔。
注意:我那个第一次出现的form是splash的form,不是应用程序的主form!
只有一次没有发生这个问题,那时我load了一副50k左右的bmp。我现在load一副100多k的jpg就有如上反应
程序有两个form,一个叫splash,一个叫form1
我的splash方法是
1.引进一个form,起名splash,修改它的bordericons为空,borderstyle属性值为bs none,
2.再在窗口里放一个Image控件,align设为all client
3.image的picture属性引进一副图画,stretch设为true
4.使该form在主程序窗口之前显现,持续一段时间再消去。
我在工程文件的代码中写下了这样的话
begin
Application.Initialize;
Splash:=TSplash.Create(Application);
Splash.Show;
Splash.Update;
Application.CreateForm(TForm1, Form1);
Splash.Free;
Application.Run;
end;
当然还有主窗体form1的延时
procedure TForm1.FormCreate(Sender: TObject);
var
CurTime:longword;
delaytime:longword;
begin
delaytime:=2000;
curtime:=gettickcount;
while(gettickcount<(curtime+delaytime))do;
end;