How to change a stylebook’s style resource properties from a TStyleBook object runtime


I want to be able to change style resources from a given stylebook object on FMX.
I know that I can change a specific object style by using the following commands

r1 := aButton.FindStyleResource(‘backgroundRect’) as TRectangle ;
if Assigned(r1) then
r1.Fill.Color := TAlphaColor(col);

However I need this to change for all the objects that have this style resource and not that specific “aButton”.

How am I able to do it, so that I won’t be forced to achieve this by looping through all the objects that i want to be changed?

Comments are closed.