bsp; InflateRect(r, -1, -1);
//根据百分比算出要画的进度条内容宽度
iWidth := R.Right - Round((R.Right - r.Left) * ((100 - Prosition) /
100));
case Style of
0: //进度条类型,实心填充
begin
Canvas.Brush.Color := DrawColor;
r.Right := iWidth;
Canvas.FillRect(r);
end;
1: //进度条类型,竖线填充
begin
i := r.Left;
while i < iWidth do
begin
Canvas.Pen.Color := Color;
Canvas.MoveTo(i, r.Top);
Canvas.Pen.Color := DrawColor;
canvas.LineTo(i, r.Bottom);
Inc(i, 3);
end;
end;
end;
//画好了进度条后,现在要做的就是显示进度数字了
Canvas.Brush.Style := bsClear;
if Prosition = Round(Prosition) then
S := Format(''%d%%'', [Round(Prosition)])
else
S := FormatFloat(''#0.0'', Prosition);
with PaintRect do
begin
&nbs