ArcObjects Library Reference (Controls)  

IMapControlDefault.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

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