The MouseDown event has different arguments for different objects:
Object |
See |
---|---|
RichTextEdit control |
|
Window |
Occurs when the user presses the left mouse button on the RichTextEdit control.
Event ID |
Objects |
---|---|
pbm_renlbuttondown |
RichTextEdit |
None
Long. Return code choices (specify in a RETURN statement):
0 Continue processing
Occurs when the user presses the left mouse button in an unoccupied area of the window (any area with no visible, enabled object).
Event ID |
Objects |
---|---|
pbm_lbuttondown |
Window |
Argument |
Description |
---|---|
flags |
UnsignedLong by value (the modifier keys and mouse buttons that are pressed). Values are:
In the MouseDown event, the left mouse button is always down, so 1 is always summed in the value of flags. For an explanation of flags, see Syntax 2 of MouseMove. |
xpos |
Integer by value (the distance of the pointer from the left edge of the window’s workspace in pixels). |
ypos |
Integer by value (the distance of the pointer from the top of the window’s workspace in pixels). |
Long. Return code choices (specify in a RETURN statement):
0 Continue processing
Example 1 This code in the MouseDown event displays the window coordinates of the pointer as reported in the xpos and ypos arguments:
sle_2.Text = "Position of Pointer is: " + &
String(xpos) + "," + String(ypos)
Example 2 This code in the MouseDown event checks the value of the flags argument, and reports which modifier keys are pressed in the SingleLineEdit sle_modkey:
CHOOSE CASE flags
CASE 1
sle_mkey.Text = "No modifier keys pressed"
CASE 5
sle_mkey.Text = "SHIFT key pressed"
CASE 9
sle_mkey.Text = "CONTROL key pressed"
CASE 13
sle_mkey.Text = "SHIFT and CONTROL keys pressed"
END CHOOSE