Form - CloseQuery Event

Fired when the form is about to close

Member of Form (PRIM_FORM)

Parameters

Name

Type

Data Type

Description

Continue

*Both

Boolean

Set to false to prevent the form from closing

Details

The CloseQuery event is fired when the form is closed using the SystemMenu icon.

Explicitly using the CloseForm method will result in the event being ignored. To ensure it 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