I have a form with an embedded TFrame and with some of the components (both in the parent form and the frame) having associated attributes. I can access the parent form component attributes using:
for field in ctx.GetType(frm.ClassInfo).GetFields do
for attr in field.GetAttributes do...
I tried accessing the attributes in the frame by using the following nested in the main loop:
for subField in ctx.GetType(field.ClassInfo).GetFields do
for attr in subField.GetAttributes do...
However, this fails to pick up the frame's components as fields, and hence of course the associated attributes. Is it possible to access an embedded frame's component attributes? I'm using XE7.
What you did is ask for the fields of TRttiInstanceField
(as that is what ClassInfo
on your field variable will give you)
Correct would be to use the FieldType
property:
for subField in field.FieldType.GetFields do
for attr in subField.GetAttributes do...