OnMouseDown事件

发布时间:2012-06-25 11:51:25   来源:文档文库   
字号:

OnMouseDown Event (esriMapControl)

OnMouseDown事件

Fires when the user presses any mouse button while over the MapControl.

用户在MapControl上按下鼠标的任意键时触发。

Syntax

语法

Private Sub object_OnMouseDown(ByVal button As Long, ByVal shift As Long, ByVal x As Long, ByVal y As Long, ByVal mapX As Double, ByVal mapY As Double)

Description

The OnMouseDown event is triggered when the user presses a mouse button on the MapControl. Use the event to specify actions that will occur when a given mouse button is pressed.

用户在MapControl上按下鼠标的任意键时OnMouseDown事件被触发。使用该事件来指定鼠标按下时将引起的一些操作。

button specifies which mouse button was pressed. 1 for the left mouse button, 2 for the right mouse button, and 4 for the middle mouse button.

button返回按下鼠标键码。1表示左键状态,2表示右键状态,4表示中键状态。

shift specifies an integer corresponding to the state of the SHIFT (bit 0), CTRL (bit 1) and ALT (bit 2) keys. When none, some or all of these keys are pressed none, some or all the bits get set. These bits correspond to the values 1, 2, and 4, respectively. For example, if both SHIFT and ALT were pressed, ShiftState would return 5.

返回 SHIFTCTRLALT 键的状态,其值分别为124。当按下其中的两个或三个时,返回值为两值之和或三值之和。例如,如果SHIFT键和ALT键都被按下,则返回值为5

x is the X coordinate, in pixels, where the mouse button was pressed referenced against the origin (0, 0) of the MapControl (the top left hand corner).

返回鼠标在地图中的横坐标,单位为像素,原点为MapControl的左上角。

y is the Y coordinate, in pixels, where the mouse button was pressed referenced against the origin (0, 0) of the MapControl (the top left hand corner).

返回鼠标在地图中的纵坐标,单位为像素,原点为MapControl的左上角。

mapX is the X coordinate, in map units, where the mouse button was pressed referenced against the origin (bottom left hand corner) of the IMapControl2::Map. The values returned are in IMapControl2::MapUnits.

返回鼠标在地图中的横坐标,单位为地图单位。

mapY is the Y coordinate, in map units, where the mouse button was pressed referenced against the origin (bottom left hand corner) of the IMapControl2::Map. The values returned are in IMapControl2::MapUnits

返回鼠标在地图中的纵坐标,单位为地图单位。

本文来源:https://www.2haoxitong.net/k/doc/022f5369b84ae45c3b358c3a.html

《OnMouseDown事件.doc》
将本文的Word文档下载到电脑,方便收藏和打印
推荐度:
点击下载文档

文档为doc格式