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

IMxDocument.SelectedLayer 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.SelectedLayer Property
ArcGIS Developer Help

IMxDocument.SelectedLayer Property

The selected layer in the layer control.

[Visual Basic .NET]
Public ReadOnly Property SelectedLayer As ILayer
public ILayer SelectedLayer {get;}

Product Availability

Available with ArcGIS Desktop.


Returns the currently selected layer in the table of contents.

To select a layer in the table of contents, obtain an IContentsView reference via IMxDocument::ContentsView, then use either IContentsView::AddToSelectedItems or IContentsView::SelectedItem. To learn more, read the help for IContentsView.

See Also

IMxDocument Interface