MouseDown event
The MouseDown event has different arguments for different
objects:
|
Object |
See |
|---|---|
|
RichTextEdit control |
|
|
Window |
Syntax 1 For RichTextEdit controls
Description
Occurs when the user presses the left mouse button on the
RichTextEdit control.
Event ID
|
Event ID |
Objects |
|---|---|
|
pbm_renlbuttondown |
RichTextEdit |
Parameters
None
Return Values
Long. Return code choices (specify in
a RETURN statement):
-
0 Continue
processing
Examples
This code in a RichTextEdit control’s MouseDown
event assigns text to the SingleLineEdit sle_1 when
the user presses the left mouse button:
|
1 |
sle_1.text = "Mouse Down" |
See Also
Syntax 2 For windows
Description
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
|
Event ID |
Objects |
|---|---|
|
pbm_lbuttondown |
Window |
Parameters
|
Argument |
Description |
|---|---|
|
flags |
UnsignedLong by Values are:
In the MouseDown event, the left mouse button is always down, |
|
xpos |
Integer by value |
|
ypos |
Integer by value |
Return Values
Long. Return code choices (specify in
a RETURN statement):
-
0 Continue
processing
Examples
This code in the MouseDown event displays the window coordinates
of the pointer as reported in the xpos and ypos arguments:
|
1 |
sle_2.Text = "Position of Pointer is: " + & |
|
1 |
   String(xpos) + "," + String(ypos) |
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:
|
1 |
CHOOSE CASE flags |
|
1 |
   CASE 1 |
|
1 |
      sle_mkey.Text = "No modifier keys pressed" |
|
1 |
   CASE 5 |
|
1 |
      sle_mkey.Text = "SHIFT key pressed" |
|
1 |
   CASE 9 |
|
1 |
      sle_mkey.Text = "CONTROL key pressed" |
|
1 |
   CASE 13 |
|
1 |
      sle_mkey.Text = "SHIFT and CONTROL keys pressed" |
|
1 |
END CHOOSE |