This document is archived and information here might be outdated.  Recommended version.


IMxDocument.ContextItem Property (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > ArcMapUI > ESRI.ArcGIS.ArcMapUI > Interfaces > IM > IMxDocument Interface > IMxDocument.ContextItem Property
ArcGIS Developer Help

IMxDocument.ContextItem Property

The last item that was right-clicked.

[Visual Basic .NET]
Public Property ContextItem As Object
[C#]
public object ContextItem {get; set;}

Product Availability

Available with ArcGIS Desktop.

Remarks

This property returns the item that was last right-clicked in the table of contents.  Use this property when creating a custom context menu.  For example, after right-clicking on a layer in the table of contents, a context menu appears which has several commands including Copy and Remove.

See Also

IMxDocument Interface