ArcObjects Library Reference (ArcMapUI)  

IContentsView.ContextItem Property

The context item (could be an enumerator).

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

Product Availability

Available with ArcGIS Desktop.

Remarks

You need at least to write a minimalistic implementation of this property as shown here:

Private m_ContextItem as Variant

Private Property Let IContentsView_ContextItem(ByVal RHS As Variant)
  m_ContextItem = RHS
End Property

Private Property Get IContentsView_ContextItem() As Variant
  IContentsView_ContextItem = m_ContextItem
End Property

The ContextItem property will contain the item on which the user makes a right-click in the TOC and at this point a context menu may be shown.

At 9.0 a default context menu is shown when the user right-clicks in your custom TOC. If you need to get rid of this menu in order to implement your own you will find the Selectable Layers Tab example valuable.

See Also

IContentsView Interface