1

Topic: Substitution of behavior of the general ancestor

Class substitution on the fly is widely known:

type
TLabel = class (Vcl. StdCtrls. TLabel)
private
...
public
...
end;
TForm1 = class (TForm)
...

As a result, since these lines, the behavior that components on the form that copies created on the fly, in the unit changes. But the behavior only explicitly specified class, here it TLabel changes. If it is necessary to change similarly behavior, say, TDBText for it the above-stated code is required to be doubled.
Whether it is possible (and how?) to redefine behavior of the general ancestor (here, for TLabel and TDBText the general ancestor will be TCustomLabel, and for example, it is necessary to add in it property) so that in the current unit all descendants of this ancestor received this property?

2

Re: Substitution of behavior of the general ancestor

Whether

oop_noob wrote:

it is possible (and how?) to redefine behavior of the general ancestor (here, for TLabel and TDBText the general ancestor will be TCustomLabel, and for example, it is necessary to add in it property) so that in the current unit all descendants of this ancestor received this property?

TCustomLabelHelper = class helper for TCustomLabel

3

Re: Substitution of behavior of the general ancestor

Thanks, for my task that is necessary.
And so, with pure curiosity - without helpers the task in the described type does not dare?