Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
MouseDown, MouseUp Events Details
◄Summary► ◄Details► ◄Example► ◄Contents► ◄Index► ◄Back►
──────────────────────────────────────────────────────────────────────────────
SUB Form_{MouseDown | MouseUp} (Button AS INTEGER, Shift AS INTEGER,
X AS SINGLE, Y AS SINGLE)
SUB ctlname_{MouseDown | MouseUp} ([Index AS INTEGER,] Button AS INTEGER,
Shift AS INTEGER, X AS SINGLE,
Y AS SINGLE)
Usage Notes
■ Use a MouseDown or MouseUp event procedure to prescribe actions to occur
when a given mouse button is pressed or released.
■ Unlike the Click and DblClick events, MouseDown and MouseUp events
allow you to distinguish between the left and right mouse buttons.
■ You can write code for mouse-keyboard combinations that use the Shift,
Ctrl, and Alt keyboard modifiers and the MouseMove event.
See: ◄MouseMove Event►
■ The following applies to both Click and DblClick event procedures:
• If a mouse button is pressed while the pointer is over a form or
control, that object "captures" the mouse and receives all mouse
events up to and including the last MouseUp event. This implies that
the X, Y mouse pointer coordinates given by a mouse event may not
always be in the client area of the object that receives them;
however, they will be relative to the object's Top and Left property
values.
• If mouse buttons are pressed in succession, the object that captures
the mouse after the first press receives all mouse events until all
buttons are released.
■ Mouse events are detected within border areas of controls that have
borders. CurrentX and CurrentY values can be used to indicate when the
mouse is not in the client area of the control.
See: ◄CurrentX Property► ◄CurrentY Property►
■ You can use a MouseMove event procedure to respond to an event caused by
moving the mouse. The Button argument for MouseDown and MouseUp differs
from the Button argument used for MouseMove. For MouseDown or MouseUp,
Button indicates exactly one button per event; for MouseMove, it
indicates the current state of all buttons.