Form - CloseFormQuery Method

Close the form and fire the CloseFormQuery event to allow for confirmation

Member of Form (PRIM_FORM)

Details

Use the CloseFormQuery method to request that the form be closed, but only after triggering the CloseQuery event to see if the user really wants to close the form.
 
Explicitly using the CloseForm method will result in the CloseQuery event being ignored. To ensure this is called, use the CloseFormQuery method.

Example

This example demonstrate the behaviour of CloseForm and CloseFormQuery.
Function Options(*Direct)
Begin_Com Role(*EXTENDS #PRIM_form) Caption('CloseQuery') Height(211) Width(496) Clientwidth(480) Clientheight(172) Left(154) Top(210)
   Define_Com Class(#PRIM_CKBX) Name(#CanClose) Caption('Check to let the form close when queried') Displayposition(1) Left(15) Marginleft(2) Parent(#COM_OWNER) Tabposition(1) Top(6) Width(266)
   Define_Com Class(#PRIM_PHBN) Name(#CloseForm) Caption('CloseForm') Displayposition(2) Left(16) Parent(#COM_OWNER) Tabposition(2) Top(32) Width(161)
   Define_Com Class(#PRIM_PHBN) Name(#CloseFormQuery) Caption('CloseFormQuery') Displayposition(3) Left(16) Parent(#COM_OWNER) Tabposition(3) Top(64) Width(161)
 
   Evtroutine Handling(#Com_owner.CloseQuery) Continue(#Continue)
 
      #Continue := (#CanClose.ButtonState = Checked)
 
   Endroutine
 
   Evtroutine Handling(#CloseForm.Click)
 
      #Com_owner.CloseForm
 
   Endroutine
 
   Evtroutine Handling(#CloseFormQuery.Click)
 
      #Com_owner.CloseFormQuery
 
   Endroutine
 
End_Com
 

See also

All Component Classes

Technical Reference

Febuary 18 V14SP2