Hi,
Du kannst deiner Klasse einen eigenen Konstruktor geben:
Delphi-Quellcode:
TKlasse = class
private
public
constructor Create;
end;
constructor TKlasse.Create;
begin
inherited Create;
// Dein Code
end;
Willst du ein OnCreate Ereignis, kannst du es so machen:
Delphi-Quellcode:
TKlasse = class
private
FOnCreate: TNotifyEvent;
public
property OnCreate: TNotifyEvent read FOnCreate write FOnCreate;
constructor Create;
end;
constructor TKlasse.Create;
begin
inherited Create;
if Assigned(FOnCreate) then
FOnCreate(Self);
end;
Gruß
Neutral General
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."