改变ProgressBar的颜色

字体大小: 中小 标准 ->行高大小: 标准
change the color of a TProgressbar?



uses

CommCtrl;

procedure TForm1.Button1Click(Sender: TObject);

begin

// Set the Background color to teal

Progressbar1.Brush.Color := clTeal;

// Set bar color to yellow

SendMessage(ProgressBar1.Handle, PBM_SETBARCOLOR, 0, clYellow);

end;

WinXP风格进度条

const

{$EXTERNALSYM PBS_MARQUEE}

PBS_MARQUEE = 08;

 

procedure TForm1.FormCreate(Sender: TObject);

begin

SetWindowLong(ProgressBar1.Handle, GWL_STYLE,

GetWindowLong(ProgressBar1.Handle, GWL_STYLE) or PBS_MARQUEE);

end;

//------------------------------------------------------------------------------

procedure TForm1.Button1Click(Sender: TObject);

var

i: Integer;

begin

for i := 0 to 30 do

begin

Sleep(100);

ProgressBar1.StepIt;

Application.ProcessMessages;

end;

end;

此文章由 http://www.ositren.com 收集整理 ,地址为: http://www.ositren.com/htmls/68119.html