Window.FocusChange Method (Typed) | |
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
public virtual Usual FocusChange(
FocusChangeEvent oFocusChangeEvent
)
Request Example
View SourceParameters
- oFocusChangeEvent
- Type: FocusChangeEvent
The FocusChangeEvent object that identifies whether the focus is being gained or lost.
Return Value
Type:
UsualThis method calls Window.Default() and returns the result of Window.Default()
Remarks 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:
1METHOD FocusChange(oFocusChangeEvt) CLASS MyTopAppWindow
2IF oFocusChangeEvt:GotFocus
3oMyCursor:Show()
4oMyCursor:Position := oMyCursorPos
5ELSE
6oMyCursorPos := oMyCursor:Position
7oMyCursor:Hide()
8ENDIF
See Also