Click or drag to resize

FocusChangeEvent Class

X#
Provide information about a FocusChangeEvent, used to indicate a change in window focus (i.e., gaining or losing focus).
Inheritance Hierarchy
Object
  Event
    FocusChangeEvent
      ControlFocusChangeEvent

Namespace:  VO
Assembly:  VOGUIClasses (in VOGUIClasses.dll) Version: 2.24 GA
Syntax
 CLASS FocusChangeEvent INHERIT Event
Request Example View Source

The FocusChangeEvent type exposes the following members.

Constructors
  NameDescription
Public methodFocusChangeEvent
Initializes a new instance of the FocusChangeEvent class
Top
Properties
  NameDescription
Public propertyGotFocus
A logical value determining whether a window has either gained keyboard focus (TRUE) or is about to lose it (FALSE).
Top
Remarks
When a window comes in or out of focus, the dispatcher generates a FocusChangeEvent and sends it to Window:FocusChange(). When the input focus changes, the window losing the focus gets a FocusChangeEvent (telling it that it is losing the focus) and the window gaining the focus receives a FocusChangeEvent (telling it that it is gaining the focus). A window that has focus gets KeyEvents when the user hits the keyboard. This is similar to an active window, but an active window receives MouseEvents instead of KeyEvents. Tip: Applications using cursors should use FocusChangeEvent to determine whether to create or destroy the cursor.
Examples
The following example locks the attached data server when the window gets focus:
X#
1METHOD FocusChange(oFCE) CLASS TopAppWindow
2IF(oFCE:GotFocus)
3Server:RLock()
4ELSE
5Server:Unlock()
6ENDIF
See Also

Reference