改变ProgressBar的颜色

时间:2010-03-03 17:32:07  来源:第二电脑网  作者:第二电脑网

  第二电脑网导读:br />SendMessage(ProgressBar1.Handle, PBM_SETBARCOLOR, 0, clYellow);end;WinXP风格进度条const{$EXTERNALSYM PBS_MARQUEE}PBS_MARQUEE = 08; procedure TForm1.FormCreate(Sender: TObject);beginSetWindowLong(ProgressBar1.Handle, GWL_STYLE,GetWindo...
  正文: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;

改变ProgressBar的颜色》由第二电脑网原创提供,转载请注明:http://www.002pc.com/master/College/Language/Delphi/13019.html


关键字:

关于《改变ProgressBar的颜色》文章的评论

站内搜索: 高级搜索

热门搜索: Windows style 系统 tr IP QQ CPU 安装 function 注册 if td