在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
delphi编程修改ProgressBar的颜色
关键代码如下:
uses CommCtrl; procedure TForm1.Button1Click(Sender: TObject); // 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); SetWindowLong(ProgressBar1.Handle, GWL_STYLE, GetWindowLong(ProgressBar1.Handle, GWL_STYLE) or PBS_MARQUEE); end; //------------------------------------------------------------------------------ procedure TForm1.Button1Click(Sender: TObject); var i: Integer; for i := 0 to 30 do Sleep(100); ProgressBar1.StepIt; Application.ProcessMessages; end; end; |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论