| A mouse event is fired every time
you do something with a mouse , if
you click the mouse a Click Event
fires , if you move the mouse a MouseMove
event occurs , if you press a button
down a MouseDown event occurs and
when you release the button a MouseUp
event occurs.
Not all of the controls support the
MouseUp , MouseDown and MouseMove
events .
Of course when you click on a mouse
button in fact you generate more than
just a Click event , you also generate
a MouseDown event and a MouseUp event
.
The syntax for MouseUp , MouseDown
and MouseMoveis listed below
Syntax
Private Sub Control_MouseUp (Button
As Integer , Shift As Integer , X
As Single , Y As Single)
Private Sub Control_MouseDown (Button
As Integer , Shift As Integer , X
As Single , Y As Single)
Private Sub Control_MouseMove (Button
As Integer , Shift As Integer , X
As Single , Y As Single)
Private is the scope
Sub denotes a procedure
Control is the name of the control
in which the event is fired
MouseUp / MouseDown are the event
procedures
Button is an integer that denotes
the mouse button or combination of
mouse buttons .
Shift is an integer that reports whether
the Alt , Shift or Control keys are
held down.
x is the horizontal position of the
mouse pointer
y is the vertical position of the
mouse pointer
Mouse Button Values
| Buttons pressed |
Parameter |
| left |
1 |
| right |
2 |
| left and right |
3 |
| middle |
4 |
| left and middle |
5 |
| right and middle |
6 |
| all |
7 |
Shift Button values
| Shift keys held |
parameter |
| Shift |
1 |
| Ctrl |
2 |
| Shift + Ctrl |
3 |
| Alt |
4 |
| Shift + Alt |
5 |
| Ctrl + Alt |
6 |
| Shift + Ctrl + Alt |
7 |
|