This document is archived and information here might be outdated. Recommended version. |
Context menu event occured at the given xy location.
[Visual Basic .NET]
Public Function OnContextMenu ( _
ByVal x As Integer, _
ByVal y As Integer _
) As Boolean
[C#]
public bool OnContextMenu (
int x,
int y
);
[C++]
HRESULT OnContextMenu(
long x,
long y
);
[C++] Parameters x [in]
x is a parameter of type long y [in]
y is a parameter of type long
X is the X coordinate, in device units, where the right mouse button was pressed.
Y is the Y coordinate, in device units, where the right mouse button was pressed.
When implementing ITool to create a custom tool, write code to display a custom context menu when the right mouse button is pressed when this tool is the active tool in the OnContext method.
If your tool displays a custom context menu, it should let the application know that it handled the OnContextMenu event by returning True from the OnContext function. If you don't do this, the standard context menu will be displayed after your custom context menu.
This method does not fire in ArcGIS Engine. A context menu is implemented using IToolbarMenu in ArcGIS Engine as illustrated by the ControlsEditingSketchContextMenu command.