Autor Beitrag
karahead
Hält's aus hier
Beiträge: 7



BeitragVerfasst: Mi 13.10.04 16:23 
Hi hab mal ne Frage:
Wieso klappt mein selbst erstelltes OnClose Ereignis aber nicht mein selbsterstelltes OnCreate Ereignis?
var Form: TForm;
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
begin
  Form:= TForm.Create(Self);
  with Form do begin 
    Parent:= Self;
    OnClose:= fClose; {klappt gut}
    OnCreate:= CCreate; {es passiert einfach nichts}
  end;


Es scheint so, dass mein eigenes OnCreate noch nichtmal aufgerufen wird.
Übrigens OnShow und OnActivate werden auch nicht durchgeführt.

Danke im vorraus.
.Chef
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1112



BeitragVerfasst: Mi 13.10.04 16:24 
Weil zum Zeitpunkt deiner Zuweisung des neuen OnCreate-Ereignisses das Formular schon erstellt ist.

Gruß,
Jörg

_________________
Die Antworten auf die 5 häufigsten Fragen:
1. Copy(), Pos(), Length() --- 2. DoubleBuffered:=True; --- 3. Application.ProcessMessages bzw. TThread --- 4. ShellExecute() --- 5. Keine Vergleiche von Real-Typen mit "="!
raziel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2453

Arch Linux
JS (WebStorm), C#, C++/CLI, C++ (VS2013)
BeitragVerfasst: Mi 13.10.04 16:25 
Weil die Form bereits "created" ist! Du erstellst Sie, bevor Du OnCreate zuweist...

//edit: zu früh...

_________________
JSXGraph
karahead Threadstarter
Hält's aus hier
Beiträge: 7



BeitragVerfasst: Mi 13.10.04 16:41 
Aha klingt einleuchtend :idea:
Und wie soll ich es dann machen?

Erst zuweisen und dann Create geht doch nicht, oder?
sourcehunter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 482

Win XP | Suse 10.1
Delphi 2005 Pers.
BeitragVerfasst: Mi 13.10.04 17:09 
Ruf doch einfach die OnCreate Prozedur noch einmal auf.

_________________
Linux und OpenSource rulez!