Skip to content

OnMouseUp - cWinControl

Received whenever a mouse button is released on the control

Type: Event

Parameters

Parameter Type Description
eButton Integer the mouse button that was pressed. It will be one of the following constants: ConstantMeaning
x Integer Specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
y Integer Specifies the y-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
fKeys Integer the keys that were pressed when the mouse button was pressed. It will be one or more of the following constants:ConstantMeaning

Syntax

Procedure OnMouseUp Integer eButton Integer x Integer y Integer fKeys

Description

Whenever a user releases a mouse button, it will recieve an OnMouseUp event.

Col 1 Col 2
Note: Mouse messages are sent to the window beneath the cursor, unless it is captured, in which case the captured window will receive the mouse messages.

This sample shows how to extract the information from the eButton and fKeys parameters:

Procedure OnMouseUp Integer eButton Integer x Integer y Integer fKeys
    Integer bShiftKey bControlKey bLeftButton bRightButton
    String sButton

    Move (IsFlagIn(mkShift, fKeys))   To bShiftKey
    Move (IsFlagIn(mkControl, fKeys)) To bControlKey
    Move (IsFlagIn(mkLeft, fKeys))    To bLeftButton
    Move (IsFlagIn(mkRight, fKeys))   To bRightButton

    If (eButton = mbLeft) Move 'Left Button' To sButton
    If (eButton = mbRight) Move 'Right Button' To sButton

    Showln 'OnMouseUp ' sButton ' ' x ' ' y ;
      'shift=' bShiftKey ' ctrl=' bControlKey ;
      'left=' bLeftButton ' right=' bRightButton
End_Procedure

See Also

OnMouseDoubleClick | OnMouseMove | OnMouseDown