MouseUp Event

Applies to:  MouseEvents
See also:  Window object

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

Syntax:

Public Event MouseUp(ByRef Window As Window, ByVal Button As MouseButtonConstants, ByVal Shift As Boolean, ByVal Control As Boolean, ByVal x As Long, ByVal y As Long, Byref Cancel As Boolean)

The MouseUp 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 button was released.
Button A value indicating which button was released.  Can be one of vbLeftButton, vbMiddleButton, vbRightButton.
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.
Cancel A boolean value that determines whether Window will receive the MouseUp event.  Setting Cancel to True prevents the event from being passed on.  This parameter is only included for the sake of completeness.  It is more useful to cancel a MouseDown event. 

Example:

Trapping mouse events

 

Home Copyright and Disclaimer