[Lazarus] Modifying Form Event

Mattias Gaertner nc-gaertnma at netcologne.de
Thu Mar 13 14:07:03 CET 2014


On Thu, 13 Mar 2014 13:51:48 +0100
Hans-Peter Diettrich <DrDiettrich1 at aol.com> wrote:

>[...]
> Here formMain.OnCloseQuery := @MyFormCloseQuery should be sufficient, 

Compiler will refuse that.


>[...]
> When your formMain closes anyway, I'd suggest to write an OnClose 
> handler and set CloseAction to caNone there.
> 
> AFAIR OnCloseQuery is intended for ending an application, where the 
> application denies ending when any form reports CanClose=False. Closing 
> individual forms instead should be handled in OnClose.

OnCloseQuery defines if to close or not, OnClose defines how to
close.

Mattias




More information about the Lazarus mailing list