Autor Beitrag
Aya
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Fr 20.12.02 02:25 
Hi,

Ich bastel an einer Komponente rum, die etwas im OnCreate-Ereigniss des Forms hinzufügen muß...

ich mache das derzeit so:

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
type
  private
    OldCreate: procedure(Sender: TObject);
  [...]

Constructor TMyKompo.Create(Owner: TComponent);
begin
  Inherited Create(Owner);
  OldCreate:=@TForm(Owner).OnCreate;
  TForm(Owner).OnCreate:=fCreate;
end;

procedure TMyKompo.fCreate(Sender: TObject);
begin
  //Mein Code
  if Assigned(OldCreate) then
    OldCreate(Sender);
end;


Klappt auch soweit, einziges problem ist.. wenn ich Delphi beende, und mein Projekt dann wieder öffne, ist das OnCreate-Ereigniss im ObjektInspektor leer...

Gibt es dafür noch andere möglichkeiten???

Au'revoir,
Aya
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Fr 20.12.02 10:30 
Aya hat folgendes geschrieben:
Ich bastel an einer Komponente rum, die etwas im OnCreate-Ereigniss des Forms hinzufügen muß...

Was muss die Komponenten denn im OnCreate-Event der Form machen?

Gruß
TINO
Aya Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Fr 20.12.02 14:45 
nich viel, aber z.B. die Breite des Forms muß verändert werden :)