Einzelnen Beitrag anzeigen

Kas Ob.

Registriert seit: 3. Sep 2023
215 Beiträge
 
#9

AW: eigenartiges Verhalten bei Onclose eines Formulars

  Alt 12. Okt 2023, 09:08
Die Form ist nicht mit ShowModal geöffnet sondern nur mit Show.

Beim schließen der Form wird das onClose Event getriggert -> FormClose

in FormClose wird eine callback funktion des parents aufgerufen in welcher

form.Release;
form := nil;

gesetzt wird.

Bei Release wird das onDestroy Event getriggert und führt im Formular das geschlossen wird, die Prozedur FormDestroy auf.


So ist im Moment der Ablauf bei mir.
So you are not mentioning what the form has for "Action: TCloseAction" in FormClose, yet you releasing it from the MainForm !!

I suggest to use one method to close/release a form, not both at the same time, one method will do the job right, two will burn the meal for sure.
  Mit Zitat antworten Zitat