MouseUpChild Event

Applies to:  Subclasser object
See also:  

The MouseDownChild event occurs when the subclassed window has captured mouse input, and a mouse button is pressed whilst the mouse pointer is within a child window of the subclassed window.

Syntax:

Private Sub object_MouseUpChild(ByVal hWndChild As Long, ByVal Button As MouseButtonConstants, ByVal Shift As Boolean, ByVal Control As Boolean, ByVal x As Long, ByVal y As Long, Cancel As Boolean)

The MouseDownChild event syntax has these parts:

Part Description
object The name of a SubClasser object, declared using WithEvents.
hWndChild The handle of the child window in which the mouse button was pressed.
Button A value indicating which button was clicked.  Can be any one of the following values:
  • vbLeftButton
  • vbMiddleButton
  • vbRightButton
Shift A boolean value indicating the state of the Shift key.  A value of True indicates that one or both Shift keys are down.
Control A boolean value indicating the state of the Control key.  A value of True indicates that one or both Control keys are down
x The x coordinate (in pixels) of the mouse pointer at the time it was clicked, relative to the top-left corner of the window or control.
y The y coordinate (in pixels) of the mouse pointer at the time it was clicked, relative to the top-left corner of the window or control.
Cancel A boolean value indicating whether to cancel normal processing of the MouseDown event.  Setting Cancel = True in response to a MouseDownChild event will alter the processing of normal MouseDown events, so that a double click will be interpreted by the control as a single MouseDown and other MouseDown events will be cancelled.

Remarks:

The MouseUpChild event is only raised if the subclassed window has captured mouse input.  To enable the MouseDownChild and MouseUpChild events, call TrackMouse in the MouseEnter event.  This will disable normal processing of mouse messages by child windows, and will allow the Subclasser object to handle messages that would normally be processed by child windows.

Refer to the example given in MouseDownChild

Home

Copyright and Disclaimer