Inno Setup入門(二十三)——Inno Setup類參考(9)
今天就簡單說一下ProgressBar。
TNewProgressBar = class(TWinControl)
property Min: Longint; read write;
property Max: Longint; read write;
property Position: Longint; read write;
property State: TNewProgressBarState read write;
property Style: TNewProgressBarStyle read write;
end
可用TNewProgressBarState 設定狀态 (npbsNormal, npbsError, npbsPaused)
使用TNewProgressBarStyle設定風格 (npbstNormal, npbstMarquee)
隻貼代碼段:
[code]
var
myPage:TWizardPage;
pb1, pb2,pb3:TNewProgressBar;
procedure InitializeWizard();
begin
myPage:=CreateCustomPage(wpWelcome, '标題:自定義頁面', '描述:這是我的自定義頁面');
pb1 := TNewProgressBar.Create(mypage);
pb1.Left:=20;
pb1.Top:=20;
pb1.Parent := mypage.Surface;
pb1.State := npbsError;
pb1.Position := 25;
pb2 := TNewProgressBar.Create(mypage);
pb2.Left:=20;
pb2.Top:=50;
pb2.Parent := mypage.Surface;
pb2.Position := 50;
pb3 := TNewProgressBar.Create(mypage);
pb3.Left:=20;
pb3.Top:=80;
pb3.Parent := mypage.Surface;
pb3.Position := 76;
{Position設定了也沒用}
pb3.Style:=npbstMarquee;
end;
運作效果