Hi there;
The purpose is to have a base class from which the objects of my application are derived. I want to whenever I will change the color of the base class, it will afect the objects of my application. The problem is Delphi saves the values of the objects properties in a file .xfm and it will load those defaults values. So, if I have 40 buttons in different forms and I want to change the color of the buttons I have to go manually thru all of them.
I tried to change the color in the constructor of the base class but it didnt work.
This is the base class of Button objects :
TButtonHabab = class(TButton)
public
{ Public declarations }
constructor Create (AOwner: TComponent); override;
procedure TranslateMyCaption();
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('Standard', [TButtonHabab]);
end;
{ TButtonHabab }
constructor TButtonHabab.Create(AOwner: TComponent);
begin
inherited; Create (AOwner);
Color:= clOlive;
end;
end.
The purpose is to have a base class from which the objects of my application are derived. I want to whenever I will change the color of the base class, it will afect the objects of my application. The problem is Delphi saves the values of the objects properties in a file .xfm and it will load those defaults values. So, if I have 40 buttons in different forms and I want to change the color of the buttons I have to go manually thru all of them.
I tried to change the color in the constructor of the base class but it didnt work.
This is the base class of Button objects :
TButtonHabab = class(TButton)
public
{ Public declarations }
constructor Create (AOwner: TComponent); override;
procedure TranslateMyCaption();
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('Standard', [TButtonHabab]);
end;
{ TButtonHabab }
constructor TButtonHabab.Create(AOwner: TComponent);
begin
inherited; Create (AOwner);
Color:= clOlive;
end;
end.