Autor Beitrag
karatekid234
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18



BeitragVerfasst: Sa 23.12.06 11:07 
Kann man TForm1.FormCreate auch über den Code aufrufen?
Wenn ja, was müsste ich in dem Fall angeben?
TForm1.Fromcreate(was kommt hier rein?);
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Sa 23.12.06 11:38 
ausblenden Delphi-Quelltext
1:
Form1 := TForm1.Create( Applicaton);					

oder
ausblenden Delphi-Quelltext
1:
Form1 := TForm1.Create(self);					

oder
ausblenden Delphi-Quelltext
1:
Form1 := TForm1.Create(Nil);					


Im ersten Fall wird das Fenster bei m Beenden des Programmes vom Application-Object freigegeben. Im 2. beim Freigeben des Fensters in dessen Code Frm1 erzeugt wird. Im 3. Fall muß es manuell geschehen.

_________________
Markus Kinzler.
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Sa 23.12.06 12:00 
@mkinzler: Er möchte IMHO nur das Ereignis aufrufen, nicht ein neues Form erstellen.

Das ist natürlich nicht sauber. Deshalb lagere den Source im OnCreate in eine Extra-Prozedur aus und rufe diese dann auf.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)