This event occurs when a user releases a button on a mouse device.
Private Sub object_MouseUp(button, shift, x, y)
Use a MouseUp event procedure to specify actions that will occur when a user presses or releases a button of a mouse device. Unlike the Click and DblClick events, MouseUp events enable you to distinguish between the left and right buttons on a mouse device.
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 | Not supported. |
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. |
You can use a MouseMove event procedure to respond to an event caused by moving the mouse device. The button parameter for MouseUp differs from the button parameter used for MouseMove. For MouseUp, the button parameter indicates exactly one button per event, whereas for MouseMove, the button parameter indicates the current state of all buttons.