This event occurs when a user moves the mouse device.
Private Sub object_MouseMove(button, shift, x, y)
The MouseMove event is generated continually as the pointer of a mouse device moves across objects. Unless another object captures the pointer, an object recognizes a MouseMove event whenever the pointer position is within its borders.
The following table shows the constants you can use to test for the button parameter.
Constant |
Value |
Description |
vbLeftButton | 1 | Left button is pressed. |
VbRightButton | 2 | Right button is pressed. |
VbMiddleButton | 4 | Unsupported. |
The following table shows the constants you can use to test for the shift parameter.
Constant |
Value |
Description |
vbShiftMask | 1 | SHIFT key is pressed. |
VbCtrlMask | 2 | CTRL key is pressed. |
VbAltMask | 4 | ALT key is pressed. |
The button parameter for MouseMove differs from the button parameter for MouseDown and MouseUp. For MouseMove, the button parameter indicates the current state of all buttons; a single MouseMove event indicates that a user has pressed some, all, or no buttons. For MouseDown and MouseUp, the button parameter indicates exactly one button per event.