Article ID: 131181
Article Last Modified on 2/15/2000
Action ReleaseType Value QueryUnload Called? --------------------------------------------------------------- QUIT 2 Yes CLEAR WINDOWS 1 Yes RELEASE WINDOWS 1 Yes Click in Close Box 1 Yes RELEASE thisform 0 NoNote 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.
*--------------------------------------------------------------*
* Program: QUNLDTST - QueryUnload test code *
* Purpose: Demonstrates trapping user exit from form. *
*--------------------------------------------------------------*
cMessageTitle = 'Test'
cMessageText = 'Did you *really* mean to close this form?'
nDialogType = 4 + 32 + 256
* 4 = Yes and No buttons
* 32 = Question mark icon
* 256 = Second button is default
nAnswer = MESSAGEBOX(cMessageText, nDialogType, cMessageTitle)
DO CASE
CASE nAnswer = 6
RELEASE THISFORM
CASE nAnswer = 7
NODEFAULT
ENDCASE
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 query words: VFoxWin
Keywords: kbcode KB131181