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


IMxDocument.ContextItem Property (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference (ArcMapUI)  

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