Inno Setup入門(二十三)——Inno Setup類參考(9)

今天就簡單說一下ProgressBar。code

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;

運行效果:
相關文章
相關標籤/搜索