>Is there any way to tell if the user clicked the X to close a form, or if they clicked a code-bearing button? Short of setting some sort of flag or parameter to QueryUnload ?
>
>help?
>Tim
Tim,
This can be a bit confusing. With the X the queryunload fires, but with a clla to the Releae mehtod the queryunload does not fire. I coded my form class so the Release emthod calls the queryunload and respects the return vlaue form it. All of my testing for shut down ok is in the queryunload and I return .T. if all is ok and .F. if not. The release looks like this;
IF NOT THISFORM.QueryUnload()
NODEFAULT
RETURN
ENDIF
The form's ReleaseType property can be queried in the queryunload to find out if the object variable was released (0), the close button was used (1), or the user is quiting VFP (2).