TTMSFMX7SegLED Change Color

Hello,

how can I change the color of a number (TTMSFMX7SegLED) ?

I try

leddisp.Shape.FillActive.Color := clagreen; in On Show event.

But this produce an error.

regards Frank


After setting the color, call UpdateLedObjects.

Example:

procedure TForm1.TMSFMX7SegLED1ApplyStyleLookup(Sender: TObject);
begin
 TMSFMX7SegLED1.Shape.FillActive.Color := clagreen;
 TMSFMX7SegLED1.UpdateLedObjects
end;

Thank you, now it works.

How remove the Shape.Fill color , default is gray, because it disturb reading ...

In the IDE select "Edit custom style" from the component content menu and in the style editor you can edit all colors.

by code is possible ?    Shape.Fill.Kind:=TBrushKind.bkNone; remove only a part of gray i want to remove all ...


Yes, you can access all style information programmatically after calling NeedStyleLookup / ApplyStyleLookup.

can you provide me a code please ? thx



var
  s: TTMSFMX7SegLED;
begin
  s := TTMSFMX7SegLED.Create(Self);
  s.Parent := Self;
  s.NeedStyleLookup;
  s.ApplyStyleLookup;
  s.Shape.Fill.Kind := TBrushKind.None;
  s.Shape.Stroke.Kind := TBrushKind.None;
  s.UpdateLedObjects;

hi on win fmx i use follow code to remove default is gray, because it disturb reading ...


procedure TfrmTDPMon.ledApplyStyleLookup(Sender: TObject);
begin
 With (Sender AS TTMSFMX7SegLed) Do Begin
   Shape.Fill.Kind:=TBrushKind.None;
   Shape.Stroke.Kind:=TBrushKind.None;

   UpdateLedObjects();
 End;
end;

But on android doesnt work ! Can you help me ?

Can you use the code as originally mentioned?

yes dont go ... i see always gray lines on android. On win go fine

Please use this code instead:




var
  s: TTMSFMX7SegLED;
begin
  s := TTMSFMX7SegLED.Create(Self);
  s.Parent := Self;
  s.NeedStyleLookup;
  s.ApplyStyleLookup;
  s.Shape.Fill.Color := TAlphaColorRec.Null;
  s.Shape.Stroke.Color := TAlphaColorRec.Null;
  s.Shape.Fill.Kind := TBrushKind.None;
  s.Shape.Stroke.Kind := TBrushKind.None;
  s.UpdateLedObjects;
end;

Go fine thx