?? splash.pas
字號(hào):
unit Splash;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, Gauges, OleCtrls, ShockwaveFlashObjects_TLB;
type
TfrmSplash = class(TForm)
lblStatus: TLabel;
Gauge1: TGauge;
swfSplash: TShockwaveFlash;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
procedure RepaintForm;
public
{ Public declarations }
procedure BeginLoad;
procedure EndLoad;
procedure UpdateLoadStatus(const AStatusText: string; AProgress: Integer);
end;
var
frmSplash: TfrmSplash;
implementation
{$R *.dfm}
{ TfrmSplash }
procedure TfrmSplash.BeginLoad;
begin
lblStatus.Caption := '正在裝載……';
Gauge1.Progress := 0;
RepaintForm;
end;
procedure TfrmSplash.EndLoad;
begin
lblStatus.Caption := '裝載完畢';
Gauge1.Progress := 100;
RepaintForm;
end;
procedure TfrmSplash.FormCreate(Sender: TObject);
begin
swfSplash.Movie := ExtractFilePath(ParamStr(0)) + 'splash.swf';
lblStatus.Caption := '';
Gauge1.MinValue := 0;
Gauge1.MaxValue := 100;
end;
procedure TfrmSplash.RepaintForm;
var
I: Integer;
begin
Show;
Update;
{ 為了演示,特延長(zhǎng)時(shí)間 }
I := 5000000;
while I > 0 do
begin
Dec(I);
Application.ProcessMessages;
end;
end;
procedure TfrmSplash.UpdateLoadStatus(const AStatusText: string;
AProgress: Integer);
begin
lblStatus.Caption := AStatusText;
Gauge1.Progress := AProgress;
RepaintForm;
end;
end.
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -