Window.QueryClose Method (Typed) | |
Provide a method that is invoked just before the window closes to confirm if the application really wants to close the window.
Provide a method that is invoked just before the window closes to confirm if the application really wants to close the window.
Namespace:
XSharp.VO.SDK
Assembly:
XSharp.VOGUIClasses (in XSharp.VOGUIClasses.dll) Version: 2.21
Syntax VIRTUAL METHOD QueryClose(
oEvent AS Event
) AS LOGIC
public virtual bool QueryClose(
Event oEvent
)
Request Example
View SourceParameters
- oEvent
- Type: Event
An empty event required to maintain the protocol that all event handlers have exactly one event as their argument.An empty event required to maintain the protocol that all event handlers have exactly one event as their argument.
Return Value
Type:
Logic
The method inside the window class always returns TRUE.
If you override this method in your subclass then you must return TRUE if the window is to be closed; otherwise, return FALSE.
Return Value
Type:
Logic
The method inside the window class always returns TRUE.
If you override this method in your subclass then you must return TRUE if the window is to be closed; otherwise, return FALSE.
Remarks Tip |
---|
Important! This is a callback method used by X#.
Normally, it should not be called in your application code.
|
When a user tries to close an application by selecting the Close menu command from a system menu (or by using another method to end the session), the system calls each window's QueryClose() event handler.
Tip |
---|
If you reimplement this method in your subclass, it is recommended that you first call SUPER:QueryClose() within the method to obtain its default behavior. |
Remarks Tip |
---|
Important! This is a callback method used by X#.
Normally, it should not be called in your application code.
|
When a user tries to close an application by selecting the Close menu command from a system menu (or by using another method to end the session), the system calls each window's QueryClose() event handler.
Tip |
---|
If you reimplement this method in your subclass, it is recommended that you first call SUPER:QueryClose() within the method to obtain its default behavior. |
Examples
This example displays a message box to confirm that a user wants to quit the application. If a user chooses YES, TRUE is returned (otherwise, FALSE is returned).
1METHOD QueryClose(oEvent) CLASS TopAppWindow
2oTB := TextBox{SELF, "Quit", "Do you really want to quit?"}
3oTB:TYPE := BOXICONQUESTIONMARK + BUTTONYESNO
4IF (oTB:Show() = BOXREPLYYES)
5RETURN TRUE
6ELSE
7RETURN FALSE
8
9END
Examples
This example displays a message box to confirm that a user wants to quit the application. If a user chooses YES, TRUE is returned (otherwise, FALSE is returned).
1METHOD QueryClose(oEvent) CLASS TopAppWindow
2oTB := TextBox{SELF, "Quit", "Do you really want to quit?"}
3oTB:TYPE := BOXICONQUESTIONMARK + BUTTONYESNO
4IF (oTB:Show() = BOXREPLYYES)
5RETURN TRUE
6ELSE
7RETURN FALSE
8
9END
See Also