1. Home
  2. Computing & Technology
  3. Delphi Programming

How to Change the Colors of the TProgressBar

By Zarko Gajic, About.com

The TProgressBar Delphi component displays a simple progress bar. Progress bars provide users with visual feedback about the progress of a procedure within an application.

By design, the colors of a progress bar are determined by Windows. Here's how to change the background color and the bar color of a TProgressBar component, at run-time (download sample application):

uses CommCtrl, ...
...
// Set Background color
ProgressBar1.Brush.Color := clRed;
// Set Bar color
SendMessage(ProgressBar1.Handle, PBM_SETBARCOLOR, 0, clBlue) ;

Delphi tips navigator:
» How to Clone a Delphi Form
« How to Right Align a Menu Item

More Delphi Programming Quick Tips
Explore Delphi Programming
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Delphi Programming
  4. Using VCL Components
  5. TProgressBar
  6. How to Change the Colors of the TProgressBar

©2009 About.com, a part of The New York Times Company.

All rights reserved.