Given the following code snippet below, using GetPropValue(MyComponent,'MySubComponent.Prop1')
raises an EPropertyError exception.
How can I retrieve or set the values of SubProperties using GetPropValue / SetPropValue?
Type
TMySubComponent = class(TInterfacedPersitent)
private
FProp1: Integer;
published
property Prop1: integer read FProp1 write FProp1;
end;
TMyComponent = class(TCompoent)
private
FMySubComponent : TMySubcomponent;
published
property MySubComponent: TMySubComponent read FMySubComponent write FMySubComponent ;
end;
Best Answer
As Robert says the dot notation is not supported , but you can create easily a function to set or get a sub-property value using the RTTI. check this sample