Delphi窗體狀態欄檢查框效果,實現類似進度條效果的狀態欄,不知道如何在窗體上加進度條的可參考下,代碼還是相當簡單的。
01
unit
Unit1;
02
interface
03
uses
04
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
05
Dialogs, Buttons, ImgList, StdCtrls, ComCtrls, jpeg, ExtCtrls, ActnList,
06
XPStyleActnCtrls, ActnMan, ToolWin, ActnCtrls, ActnMenus;
07
type
08
TForm1 =
class
(TForm)
09
StatusBar1: TStatusBar;
10
ProgressBar1: TProgressBar;
11
Timer1: TTimer;
12
procedure
FormCreate(Sender: TObject);
13
procedure
Timer1Timer(Sender: TObject);
14
private
15
{ Private declarations }
16
public
17
{ Public declarations }
18
end
;
19
var
20
Form1: TForm1;
21
implementation
22
{$R *.dfm}
23
procedure
TForm1
.
FormCreate(Sender: TObject);
24
begin
25
ProgressBar1
.
Parent := StatusBar1;
26
ProgressBar1
.
Left := StatusBar1
.
Width-ProgressBar1
.
Width;
27
ProgressBar1
.
Top :=
4
;
28
ProgressBar1
.
Show;
29
StatusBar1
.
Panels[
3
].Text :=
'明日科技'
;
30
end
;
31
procedure
TForm1
.
Timer1Timer(Sender: TObject);
32
begin
33
ProgressBar1
.
Position:=ProgressBar1
.
Position+
5
;
34
if
ProgressBar1
.
Position>=
100
then
35
begin
36
timer1
.
Enabled :=
false
;
37
showmessage(
'窗體已成功載入'
);
38
ProgressBar1
.
Position:=
0
;
39
end
;
40
end
;
41
end
.
在窗體的狀態欄顯示進度條的例子,Delphi代碼實現。