Frequently Asked Component Specific Questions

Options

Display all FAQ items

Search FAQ items:


Displaying items 1 to 1 of 1, page 1 of 1

<< previous next >>

TMS FMX UI Pack
TTMSFMXProgressBar: How to change the color of the progressbar

The TTMSFMXProgressBar inherits from TProgressBar so you can style identical to TProgressBar. You can either change the hindicator or vindicator TRectangle (based on the orientation) in the stylebook, or programmatically In the OnApplyStyleLookup event.

Example:

procedure TForm1.FormCreate(Sender: TObject);
begin
  TMSFMXProgressBar1.Value := 75;
end;

procedure TForm1.TMSFMXProgressBar1ApplyStyleLookup(Sender: TObject);
var
  r: TRectangle;
begin
  r := TMSFMXProgressBar1.FindStyleResource(''hindicator'') as TRectangle;
  r.Fill.Color := claRed;
  r.Fill.Kind := TBrushKind.Solid;
end;