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


IMapControl3.DeleteLayer Method (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Controls > ESRI ArcGIS Controls > Interfaces > IM > IMapControl3 Interface > IMapControl3.DeleteLayer Method
ArcGIS Developer Help

IMapControl3.DeleteLayer Method

Removes a Layer from the Map's collection of layers at the specified index position.

[Visual Basic .NET]
Public Sub DeleteLayer ( _
    ByVal index As Integer _
)
[C#]
public void DeleteLayer (
    int index
);
[C++]
HRESULT DeleteLayer(
  long index
);
[C++]
Parameters
index [in]

index is a parameter of type long

Product Availability

Available with ArcGIS Engine.

Description

This method is a shortcut to IMap::DeleteLayer.

Errors Returned

1023 800a03ff: The specified index is out of range

See Also

IMapControl3 Interface | IMapControl4.ClearLayers Method | IMapControl2.ClearLayers Method | IMapControl3.ClearLayers Method | IMapControl4.Layer Property | IMapControl3.Layer Property | IMapControl2.Layer Property | IMapControl4.LayerCount Property | IMapControl3.LayerCount Property | IMapControl2.LayerCount Property | IMapControl2.MoveLayerTo Method | IMapControl4.MoveLayerTo Method | IMapControl3.MoveLayerTo Method