ArcObjects Library Reference (SystemUI)  

ITool.OnMouseDown Method

Occurs when a mouse button is pressed when this tool is active.

[Visual Basic .NET]
Public Sub OnMouseDown ( _
    ByVal button As Integer, _
    ByVal shift As Integer, _
    ByVal x As Integer, _
    ByVal y As Integer _
)
[C#]
public void OnMouseDown (
    int button,
    int shift,
    int x,
    int y
);
[C++]
HRESULT OnMouseDown(
  long button,
  long shift,
  long x,
  long y
);
[C++]

Parameters

button [in]   button is a parameter of type long shift [in]   shift is a parameter of type long x [in]   x is a parameter of type long y [in]   y is a parameter of type long

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Description

button specifies which mouse button is pressed. The button argument is a bit field. Some, all, or none of the bits can be set indicating that some, all, or none of the mouse buttons are pressed. The values for button are as follows:

      1   Left button
      2   Right button
      3   Left and Right buttons
      4   Middle button
      5   Left and Middle buttons
      6   Right and Middle buttons
      7   All buttons

Shift indicates whether the Shift key, Ctrl key, or Alt key is pressed when the mouse button is pressed. The Shift argument is a bit field. Some, all, or none of the bits can be set indicating that some, all, or none of the keys are pressed. The values for Shift are as follows:

      0   No key pressed
      1   Shift key pressed
      2   Ctrl key pressed
      3   Shift and Ctrl keys pressed
      4   Alt key pressed
      5   Shift and Alt keys pressed
      6   Ctrl and Atl keys pressed
      7   Shift, Ctrl, and Alt keys pressed

X is the X coordinate, in device units, where the mouse button was pressed.

Y is the Y coordinate, in device units, where the mouse button was pressed.

Remarks

When implementing ITool to create a custom tool, write the code that performs the action when the left mouse button is pressed when this tool is the active tool in the OnMouseDown method.

See Also

ITool Interface