Forum: GUI-Design mit VCL / FireMonkey / Common Controls
Delphi
by Uwe Raabe,
13. Mai 2021
Eventuell eher so:
for Prop in RType.GetProperties do
begin
if Prop.Name = sPropColor then
Prop.SetValue(AObject, FColorBackground);
if Prop.PropertyType.IsInstance and Prop.PropertyType.AsInstance.MetaclassType.InheritsFrom(TFont) and (Prop.Name = sPropFont) then
TFont(prop.GetValue(AObject).AsObject).Color := FColorText;
end;
Forum: GUI-Design mit VCL / FireMonkey / Common Controls
Delphi
by Uwe Raabe,
10. Mai 2021
Ich fürchte bei Font.Color wird es nicht funktionieren, denn das Property ist Font und der hat ein Property Color. Also sollte man nach Property Font suchen und sich die Font-Instanz holen, um dessen Color zu setzen.