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


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

IMxDocument.SelectedLayer Property

The selected layer in the layer control.

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

Product Availability

Available with ArcGIS Desktop.

Remarks

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