Forum > LCL

Initializing TFrame private variables. Where?

(1/2) > >>

Leledumbo:
TFrame doesn't have OnCreate or something similar. So how can I initialize its private variables?

Imants:
Just override existing constructor like this:

  TFrame1 = class(TFrame)
  private
    MyVar: Integer;
  public
    constructor Create(TheOwner: TComponent); override;
  end;


.....

constructor TFrame1.Create(TheOwner: TComponent);
begin
  inherited Create(TheOwner);
  MyVar := 0;
end;

Leledumbo:
Hahaha... I guess I was too sleepy to think about it. Thanks.

wOvAN:

--- Code: ---  Frame1 = class(TFrame)
  public
    { public declarations }
    procedure AfterConstruction; override;
    procedure BeforeDestruction; override;
  end;
--- End code ---

mas steindorff:
since were on frames....
I have a project that uses a TFrame. 
When I Update the Frame's looks at design time, the copies on the form do not change.
When I run the program, all looks and works well. 

Is there an easy way to update the frames I've placed other than to delete them and add them back in?

Navigation

[0] Message Index

[#] Next page

Go to full version