MouseEvent.y Property
Visio Automation Reference |
Returns the y-coordinate of the location in the Microsoft Office Visio window where a MouseDown, MouseMove, or MouseUp event fired. Read-only.
Version Information
Version Added: Visio 2003
Syntax
expression.y
expression A variable that represents a MouseEvent object.
Return Value
VisStatCodes
Remarks
The y property returns a value in internal drawing units.
Example
This class module shows how to define a sink class called MouseListener that listens for events fired by mouse actions in the active window. It declares the object variable vsoWindow by using the WithEvents keyword. The class module also contains event handlers for the MouseDown, MouseMove, and MouseUp events.
To run this example, insert a new class module in your Microsoft Visual Basic for Applications (VBA) project, name it MouseListener, and insert the following code in the module.
Visual Basic for Applications |
---|
|
Then, insert the following code in the ThisDocument project.
Visual Basic for Applications |
---|
|
Save the document to initialize the class, and then click anywhere in the active window to fire a MouseDown event. In the Immediate window, the handler prints the x and y coordinates of the location in the Visio window coordinate space where the mouse was clicked.
See Also