This document is archived and information here might be outdated. Recommended version. |
ArcObjects namespaces > ArcMapUI > ESRI.ArcGIS.ArcMapUI > Interfaces > IM > IMxDocument Interface > IMxDocument.SelectedLayer Property (ArcObjects .NET 10.4 SDK) |
The selected layer in the layer control.
[Visual Basic .NET] Public ReadOnly Property SelectedLayer As ILayer
[C#] public ILayer SelectedLayer {get;}
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.