How programmatically change IconTintColor of the button if I use a component TStyleBook?


I use Delphi 10.3 Version 26.0.36039.7899. In my Android app to change icon color of the "favorites" button i use this simple trick:
procedure TfMain.LinkPropertyToFieldText4AssignedValue(Sender: TObject;
AssignValueRec: TBindingAssignValueRec; const Value: TValue);
sbtnFavorites.StyledSettings := sbtnFavorites.StyledSettings – [TStyledSetting.FontColor];
if Value.AsString = ‘1’ then
sbtnFavorites.IconTintColor := TAlphaColors.Hotpink;
if Value.AsString = ‘0’ then
sbtnFavorites.IconTintColor := TAlphaColorRec.Grey;

The sbtnFavorites button has StyleLookUp = bookmarkstoolbutton and StyledSettins.FontColor = False. It works nice, the button sbtnFavorites changes its color depending on the value of the field "IsFavor" in the local database.
But if I put the component TStyleBook on the form and then assign any style (f.e. to it, then the method I have already described here does not work. The color of the button sbtnFavorites which has StyleLookUp = bookmarkstoolbutton does not change.
And here’s my question: how programmatically change the color of the button icon (IconTintColor) if I use a component TStyleBook?

Comments are closed.