MouseDown

<< Click to Display Table of Contents >>

 

MouseDown

MouseDown(Button, ShiftState, MouseX, MouseY)

This event occurs when any mouse button is pressed on a Screen. Use the MouseDown event to determine specific actions when a user clicks a Screen.

Parameters of the MouseDown event

Name

Description

Button

Displays the pressed mouse button:

1: Mouse left button pressed

2: Mouse right button pressed

4: Mouse middle button pressed

ShiftState

Displays the pressed key along with the mouse button:

4: SHIFT key

8: CTRL key

12: CTRL + SHIFT keys

MouseX

Displays Screen's X coordinate where the mouse pointer was clicked

MouseY

Displays Screen's Y coordinate where the mouse pointer was clicked

 

Example:

Sub InitialScreen_MouseDown(Button, ShiftState, MouseX, MouseY)
  ' Quits the application when a mouse click occurs
  ' on the InitialScreen object.
  Application.Exit()
End Sub

Was this page useful?