RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomForm.CloseQuery Method

Close attempt event dispatcher.

Pascal
function CloseQuery: Boolean; virtual;
C++
virtual __fastcall Boolean CloseQuery();

CloseQuery is called automatically when an attempt is made to close the form. CloseQuery can allow the form to close by returning true, or prevent the form from closing by returning false. 

As implemented in TCustomForm, CloseQuery polls any MDI children by calling their CloseQuery methods. If no child form aborts the close, CloseQuery then calls the OnCloseQuery event handler, if it exists, to determine if the close should be allowed. If no such event handler exists, CloseQuery returns true. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!