Autor Beitrag
buster
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 66
Erhaltene Danke: 7

WIN 7
Delphi 2010 Prof
BeitragVerfasst: Do 23.09.10 08:23 
Hallo,

nach langer Zeit 'darf' :) ich mich mal wieder mit Delphi beschäftigen...

Meine Frage: Ich erzeuge vom Hauptformular aus dynamisch weitere Formulare (jeweils nur eins). Wie kann ich (z.B. beim Schließen des Unterfensters) einen Event (z.B. Reload geänderter Daten) im Hauptfenster auslösen?

Es gibt bestimmt hier schon Threads zu diesem Thema, aber irgendwie gehen mir die Stichwörter aus, und ich hab bis jetzt noch nichts passendes gefunden...

LG, Basti


Moderiert von user profile iconNarses: Topic aus Sonstiges (Delphi) verschoben am Do 23.09.2010 um 22:45
martin300
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 186
Erhaltene Danke: 2



BeitragVerfasst: Do 23.09.10 09:27 
Hallo,
indem du im Event beim Schließen die Methode aufrufst. Beim Formular ist der Event zb. OnClose.
buster Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 66
Erhaltene Danke: 7

WIN 7
Delphi 2010 Prof
BeitragVerfasst: Do 23.09.10 09:51 
öhm...

dynamisch_erstelltes_Unterformular.OnClose := Hauptformular.Methode ???

Hab ich schon probiert, funktioniert aber noch nicht :( Wie müsste ich denn den Parent da aufrufen?

Erzeugt wird es im MainForm so:
ausblenden Delphi-Quelltext
1:
2:
VMPlan := TVMPlan.Create(Form1);
VMPlan.Parent := Form1;

und im Unterformular Aufruf von TVMPlan.FormClose
ausblenden Delphi-Quelltext
1:
Parent.DataReload();					
funktioniert so nicht
bummi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1248
Erhaltene Danke: 187

XP - Server 2008R2
D2 - Delphi XE
BeitragVerfasst: Do 23.09.10 10:13 
ausblenden Delphi-Quelltext
1:
2:
VMPlan := TVMPlan.Create(Form1);
VMPlan.OnClose := Self.MyOnClose4Subform;
buster Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 66
Erhaltene Danke: 7

WIN 7
Delphi 2010 Prof
BeitragVerfasst: Do 23.09.10 10:32 
Vielen Dank erstmal, klingt sehr logisch.
Leider wirft er mir jetzt folgenden Fehler an den Kopf:

E2010 Inkompatible Typen: 'TCloseEvent' und 'procedure, untyped pointer or untyped parameter' :(
martin300
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 186
Erhaltene Danke: 2



BeitragVerfasst: Do 23.09.10 10:39 
Die Paramter von OnClose müssen mit deinen zugewiesenen übereinstimmen.
bummi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1248
Erhaltene Danke: 187

XP - Server 2008R2
D2 - Delphi XE
BeitragVerfasst: Do 23.09.10 10:58 
Doppelkilck in Deinem Hauptform auf OnClose, im Objektinspektor umbenennen in MyOnClose4Subform, und im Objektinspektor wieder rausscheißen, in MyOnClose4Subform Deinen Code reinschreiben ....
buster Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 66
Erhaltene Danke: 7

WIN 7
Delphi 2010 Prof
BeitragVerfasst: Do 23.09.10 11:28 
user profile iconbummi hat folgendes geschrieben Zum zitierten Posting springen:
Doppelkilck in Deinem Hauptform auf OnClose, im Objektinspektor umbenennen in MyOnClose4Subform, und im Objektinspektor wieder rausscheißen, in MyOnClose4Subform Deinen Code reinschreiben ....


*grins* sooo schlimm ist es ja nun auch nicht :D

funktioniert bestens, Danke euch beiden!