SplashForm := TSplashForm.Create(Application); SplashForm.Show; // Display the splash screen SplashForm.Update; // Update the splash screen to ensure it gets drawn { This while loop simply uses the TTimer component on the SplashForm to simulate a lengthy process. } while SplashForm.tmMainTimer.Enabled do Application.ProcessMessages; ...... // SplashForm.FormStyle:=fsNormal; SplashForm.Hide; // Hide the splash screen SplashForm.Free; // Free the splash screen Application.Run;在splash窗口中 procedure TSplashForm.FormActivate(Sender: TObject); var Height,Width:Integer; h,w:real; begin Width := Screen.Width; Height := Screen.Height; w:=Width; h:=Height; splashform.FMmc.font.Size:=16; splashform.FMmc2.font.Size:=16; splashform.FMmcb.font.Size:=16; splashform.FMmc2b.font.Size:=16; if Width>640 then begin splashform.FMmc.font.Size:=24; splashform.FMmc2.font.Size:=24; splashform.FMmcb.font.Size:=24; splashform.FMmc2b.font.Size:=24; end; if Width >800 then begin splashform.FMmc.font.Size:=32; splashform.FMmc2.font.Size:=32; splashform.FMmcb.font.Size:=32; splashform.FMmc2b.font.Size:=32; end; splashform.Height :=trunc(H*0.5); splashform.Width := trunc(W*0.6); with splashform do begin Left := (Screen.Width - Width) div 2; // 在水平方向上居中显示。 Top:= (Screen.Height - Height) div 2; FMmc.Left := (Width - FMmc.Width) div 2; FMmcb.Left := ((Width - FMmc.Width) div 2)+1; FMmc2.Left := (Width - FMmc2.Width) div 2; FMmc2b.Left := ((Width - FMmc2.Width) div 2)+1; end; end; end.
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;Shift: TShiftState); const PageDelta = 10; begin With VertScrollbar do if Key = VK_NEXT then Position := Position + PageDelta else if Key = VK_PRIOR then Position := Position - PageDelta; end;
Label.Caption:='...';
Form.Refresh;
Form.Refresh;
应该可以
SplashForm := TSplashForm.Create(Application);
SplashForm.Show; // Display the splash screen
SplashForm.Update; // Update the splash screen to ensure it gets drawn { This while loop simply uses the TTimer component on the SplashForm
to simulate a lengthy process. }
while SplashForm.tmMainTimer.Enabled do
Application.ProcessMessages;
......
// SplashForm.FormStyle:=fsNormal;
SplashForm.Hide; // Hide the splash screen
SplashForm.Free; // Free the splash screen
Application.Run;在splash窗口中
procedure TSplashForm.FormActivate(Sender: TObject);
var
Height,Width:Integer;
h,w:real;
begin
Width := Screen.Width;
Height := Screen.Height;
w:=Width;
h:=Height; splashform.FMmc.font.Size:=16;
splashform.FMmc2.font.Size:=16;
splashform.FMmcb.font.Size:=16;
splashform.FMmc2b.font.Size:=16; if Width>640 then
begin
splashform.FMmc.font.Size:=24;
splashform.FMmc2.font.Size:=24;
splashform.FMmcb.font.Size:=24;
splashform.FMmc2b.font.Size:=24;
end;
if Width >800 then
begin
splashform.FMmc.font.Size:=32;
splashform.FMmc2.font.Size:=32;
splashform.FMmcb.font.Size:=32;
splashform.FMmc2b.font.Size:=32;
end;
splashform.Height :=trunc(H*0.5);
splashform.Width := trunc(W*0.6);
with splashform do
begin
Left := (Screen.Width - Width) div 2; // 在水平方向上居中显示。
Top:= (Screen.Height - Height) div 2;
FMmc.Left := (Width - FMmc.Width) div 2;
FMmcb.Left := ((Width - FMmc.Width) div 2)+1;
FMmc2.Left := (Width - FMmc2.Width) div 2;
FMmc2b.Left := ((Width - FMmc2.Width) div 2)+1;
end;
end;
end.
begin
label1.Caption := 'step 1, please wait 1 seconds!';
label1.Refresh;
Sleep(1000);
label1.Caption := 'step 2, please wait 2 seconds!';
label1.Refresh;
Sleep(2000);
label1.Caption := 'step 3, please wait 3 seconds!';
label1.Refresh;
Sleep(3000);
label1.Caption := 'over';
label1.Refresh;
end;用你花时间的代码替换sleep(*000)
procedure TForm1.Timer1Timer(Sender: TObject);
begin
Label1.Left := label1.Left + 5;
end;
const
PageDelta = 10;
begin
With VertScrollbar do
if Key = VK_NEXT then
Position := Position + PageDelta
else if Key = VK_PRIOR then
Position := Position - PageDelta;
end;