How to Manage the Exiting Process with QueryUnLoad EventID: Q131181 3.00 WINDOWS The information in this article applies to:
SUMMARYWhen a user attempts to leave a form, you want to query the user to ensure that they really want to leave the form. Using the QueryUnload event of a form, you can ask the user, and then take appropriate action in response.
MORE INFORMATIONAs described in the Help menu, the QueryUnload event occurs before the Destroy event. The ReleaseType property is set prior to the QueryUnload event being called. The QueryUnload event occurs when:
The following table summarizes the values for the ReleaseType property and indicates when the QueryUnload event is called.
Note that the QueryUnload event is not called when a RELEASE thisform
command is called. Therefore, if you are using the RELEASE thisform command
as a means of exiting a form, you won't be able to use the code example
below in the QueryUnload event; you'll need to use an alternate method to
achieve the same result.
Code SampleThe following code sample demonstrates how to use the QueryUnload event in a form:
The use of NODEFAULT in the DO CASE construction overrides the default
action of closing the form, in effect canceling the user's actions.
Additional reference words: 3.00 VFoxWin KBCategory: KBSubcategory: FxtoolFormdes
|
Last Reviewed: May 22, 1998 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |