MouseMove Event

Applies to:  MouseEvents
See also:  Window object

Occurs when a window is about to receive a MouseMove event.

Syntax:

Public Event MouseMove(ByRef Window As Window, ByVal Shift As Boolean, ByVal Control As Boolean, ByVal x As Long, ByVal y As Long)

The MouseMove event syntax has these parts:

Part Description
object The name of a MouseEvents object.  NB:  object must be declared using WithEvents.
Window The window in which the mouse is moving.
Shift A boolean value indicating the state of the shift button.  A vale of True indicates that the shift key is down.
Control A boolean value indicating the state of the ctrl button.  A vale of True indicates that the ctrl key is down.
x The x coordinate of the mouse pointer, in client coordinates (pixels).  May be negative, if the mouse is over the border or caption of a top-level or mdi child window.
y The y coordinate of the mouse pointer, in client coordinates (pixels).  May be negative, if the mouse is over the border or caption of a top-level or mdi child window.

Example:

Trapping mouse events

 

Home Copyright and Disclaimer