上面的步驟在實際編寫代碼時是這樣實現的
procedure TForm
var
ProgressBarStyle: integer;
begin
//將狀態欄的第二塊面板設為的自繪(即psOwnerDraw)
StatusBar
//將進程條放入狀態欄
ProgressBar
//去除狀態欄的邊框
ProgressBarStyle := GetWindowLong(ProgressBar
ProgressBarStyle := ProgressBarStyle
SetWindowLong(ProgressBar
end;
procedure TForm
begin
//注意這裡的Panels[
if Panel = StatusBar
with ProgressBar
Top := Rect
Left := Rect
Width := Rect
Height := Rect
end;
end;
關鍵問題解決之後
procedure TForm
var
i : integer;
begin
ProgressBar
ProgressBar
for i :=
begin
ProgressBar
Sleep(
end;
end;
運行一下這個小程序
[
From:http://tw.wingwit.com/Article/program/Delphi/201311/24750.html