I have the following structure in my sample program :
TFirstForm = class(Tform) //Application.MainForm
TSecondForm = class(Tform)
TThirdForm = class(TSecondForm) //inherited
TFourthForm = class(TSecondForm) //inherited
On TSecondForm i have placed a component - and this component is inherited along with others classes/components on TSecondForm.
When i change properties on the component i would like to know if i change properties on the ancestor or the inherited component.
This is what i have found :
In my component :
TMyComponent = class(tcomponent)
procedure DefineProperties(Filer: TFiler); override;
procedure TMyComponent.DefineProperties(Filer: TFiler);
if filer.Ancestor<>nil then
if Owner.InheritsFrom(tcomponent(filer.Ancestor).Owner.ClassType= true then
Can i trust this method - or is there a better way to do this ??