MouseMove Event  
 

The MouseMove event is generated when the user moves the mouse.

Syntax

Sub object_MouseMove( [Index As Integer], Button As Integer, Shift As Integer, X As Integer, Y As Integer )

Remarks

The MouseMove event is generated when the user moves the mouse over the control window. The following arguments are passed to the event handler:

Button
Returns an integer that corresponds to the state of the mouse buttons when the mouse was moved. The Button argument is a bit field with bits corresponding to the left button (bit 0), right button (bit 1), and middle button (bit 2). These bits correspond to the values 1, 2, and 4, respectively. It indicates the complete state of the mouse buttons; some, all, or none of these three bits can be set, indicating that some, all, or none of the buttons are pressed.
Shift
An integer that corresponds to the state of the Shift, Ctrl, and Alt keys at the time the mouse was moved. The Shift argument is a bit field with the least-significant bits corresponding to the Shift key (bit 0), the Ctrl key (bit 1), and the Alt key (bit 2 ). These bits correspond to the values 1, 2, and 4, respectively. Some, all, or none of the bits can be set, indicating that some, all, or none of the keys are pressed. For example, if both Ctrl and Alt keys are pressed, the value of Shift is 6.
X, Y
Returns the current location of the mouse pointer. The X and Y values are always expressed in terms of the coordinate system set by the container. To determine the current row and column where the mouse is positioned in the virtual display, use the MouseX and MouseY properties.

See Also

MouseX Property, MouseY Property, MouseDown Event, MouseUp Event