Click or drag to resize

Window.FocusChange Method (Typed)

X#
Provide a method that is invoked when the input focus changes from the current window to another (or vice versa).

Namespace:  XSharp.VO.SDK
Assembly:  XSharp.VOGUIClasses (in XSharp.VOGUIClasses.dll) Version: 2.19
Syntax
 VIRTUAL METHOD FocusChange(
	oFocusChangeEvent AS FocusChangeEvent
) AS USUAL
Request Example View Source

Parameters

oFocusChangeEvent
Type: FocusChangeEvent
The FocusChangeEvent object that identifies whether the focus is being gained or lost.

Return Value

Type: Usual
This method calls Window.Default() and returns the result of Window.Default()
Remarks
Tip Tip
Important! This is a callback method used by X#. Normally, it should not be called in your application code.
If your window uses cursors, you should hide the window's cursor when the focus is changed to a different window, and then show the cursor when the window receives focus again. This should be used in conjunction with the Window:Activate() and Window:Deactivate() event handlers.
Examples
This example demonstrates how Window:FocusChange() displays the cursor at the specified cursor position when focus is gained. If the focus is lost, the cursor is hidden:
X#
1METHOD FocusChange(oFocusChangeEvt) CLASS MyTopAppWindow
2IF oFocusChangeEvt:GotFocus     // Gaining focus
3oMyCursor:Show()
4oMyCursor:Position := oMyCursorPos
5ELSE                        // Losing focus
6oMyCursorPos := oMyCursor:Position
7oMyCursor:Hide()
8ENDIF
See Also