假设frm_Start是LOGO窗体 在项目文件 .dpr中,在创建主窗体前,加入如下: //以下三行创建封面,延时程序在主窗体的OnCreate事件中 frm_Start := Tfrm_Start.Create(Application); frm_Start.Show; frm_Start.Update;在主窗体的OnCreate事件中加入如下:procedure Tfrm_Main.FormCreate(Sender: TObject); var StopTime : LongInt; //为封面延时而设的临时变量 begin //以下三行是封面延时程序 StopTime := GetTickCount div 500; while ((GetTickCount div 500)<(StopTime+2)) do Sleep(1); end;调整Sleep的值到自己所需的时间即可。
StopTime := GetTickCount div 500; while ((GetTickCount div 500)<(StopTime+2)) do Sleep(1); end; 我一般的就是用这种方法
Sleep(3000)象是死机了,用Timer和GetTickCount比较合适
先定义一个变量StartTime记录当前时间StartTime:=Now,在Logo.show之后,Logo.Free之前加入以下语句就实现了延迟3秒 Repeat Application.ProcessMessages; Until Now>StartTime+3*(1/24/60/60);
在上面夹一个Timer然后 procedure TFrm_Flash.timDelayTimer(Sender: TObject); begin num := num + 1; if Num = 3 then begin TimDelay.Enabled := False; close; FrmMain.Update; FrmMain.Enabled := true; end; end;
这个问题的解决方法能请教一下么?
在项目文件 .dpr中,在创建主窗体前,加入如下: //以下三行创建封面,延时程序在主窗体的OnCreate事件中
frm_Start := Tfrm_Start.Create(Application);
frm_Start.Show;
frm_Start.Update;在主窗体的OnCreate事件中加入如下:procedure Tfrm_Main.FormCreate(Sender: TObject);
var
StopTime : LongInt; //为封面延时而设的临时变量
begin
//以下三行是封面延时程序
StopTime := GetTickCount div 500;
while ((GetTickCount div 500)<(StopTime+2)) do
Sleep(1);
end;调整Sleep的值到自己所需的时间即可。
Application.create(TMainForm, MainForm);
while ((GetTickCount div 500)<(StopTime+2)) do
Sleep(1);
end;
我一般的就是用这种方法
Repeat
Application.ProcessMessages;
Until Now>StartTime+3*(1/24/60/60);
procedure TFrm_Flash.timDelayTimer(Sender: TObject);
begin
num := num + 1;
if Num = 3 then
begin
TimDelay.Enabled := False;
close;
FrmMain.Update;
FrmMain.Enabled := true;
end;
end;