Add a shared variable to Tframe

120 Views Asked by At

Software is Delphi 10.2 on Windows 10

Is there an easy way to create a custom override Tframe without creating a new component based on it ?

I have several different frames designed which have common variables.

So I tried a trick I have seen before...

unit FrameExUnit;

interface

uses Forms,classes, ChromeTabs,ChrometabsClasses;

Type
 Tframe=class(Forms.Tframe)
   Tab:tchrometab;
 end;

implementation

end.

and put FrameExUnit in the uses clause of all the different frame designs.

I have used this trick for creating custom forms and I have another component (AMsplitter) which works as well, but I can't get it to work with Tframe.

The designer seems to be happy, but because these frames are created dynamically at runtime, a bunch of errors occur in the inherited create event because it can't see the inherited properties of Tframe.

I know I must be doing something silly, Is there a simple way to add variables to Tframe ?

0

There are 0 best solutions below