Click or drag to resize

DataWindow.FocusChange Method (Typed)

X#
Provide a method that is invoked when the input focus changes from the current data window to another window (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
Remarks
Tip Tip
Important! This is a callback method used by X#. Normally, it should not be called in your application code.
If your data window uses cursors, you should hide the data window's cursor when the focus is changed to a different data window, and then show the cursor when the data window receives focus again. This should be used in conjunction with the Activate() and Deactivate() event handlers.
Examples
This example demonstrates how 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 MyDataWindow
2IF oFocusChangeEvt:GotFocus    // Gaining focus
3oMyCursor:Show()
4oMyCursor:ChangePos(oMyCursorPos)
5ELSE           // Losing focus
6oMyCursorPos := oMyCursor:GetPos()
7oMyCursor:Hide()
8ENDIF
See Also