Board index » delphi » How know if a call to FormClose was successful (based on OnCloseQuery event)?

How know if a call to FormClose was successful (based on OnCloseQuery event)?


2003-07-24 10:47:21 PM
delphi43
Hi Everyone,
I have a problem that is driving me nuts and it just seems like there should
be a simple way to do this.
I have a page control component on a form where each tabsheet will become
the container for another form (whose BorderStyle is bsNone and aligned
client within the tabsheet). When the user clicks or moves to another tab,
the form within the old tab sheet gets closed and the form for the new
tabsheet gets created. However, my problem is this: it is possible that the
form cannot be closed (due to something in the OnCloseQuery event) and if so
I need to be able to detect this and cancel the pagecontrols OnPageChange
event.
I have tried everything I can think of to accomplish this but nothing works.
I cannot seem to get the pointer to the form to become nil, set it is handle
to 0 or anything.
How can I detect if a call to a Form's OnClose event was successful?? Does
anyone have any suggestions?
It just doesn't seem like this should be that difficult!!! (maybe I have been
looking at it too long????)
TIA,
Frustrated ... (Ann) ...
PS. Can provide additional information if necessary ...
 
 

Re:How know if a call to FormClose was successful (based on OnCloseQuery event)?

"Ann Weaver" <XXXX@XXXXX.COM>writes news:3f1ff15b$XXXX@XXXXX.COM...
Quote
How can I detect if a call to a Form's OnClose event was successful?? Does
anyone have any suggestions?
Something in the .OnClose will have to notify that the closing was complete,
unless Action is set to caFree, in which case you can override .Destroy and
do the notification in there.
Cheers,
Ignacio