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

IToolbarControl.Remove Method (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Controls > ESRI ArcGIS Controls > Interfaces > IT > IToolbarControl Interface > IToolbarControl.Remove Method
ArcGIS Developer Help

IToolbarControl.Remove Method

Removes the item at the specified index from the ToolbarControl.

[Visual Basic .NET]
Public Sub Remove ( _
    ByVal index As Integer _
public void Remove (
    int index
  long index
index [in]

index is a parameter of type long

Product Availability

Available with ArcGIS Engine.


Removes the item at the specified index from the ToolBarControl. The item at the beginning of the collection to the left of the ToolBarControl has an index of 0.

Errors Returned

1023 800A03FF: The specified index is out of range 


The Remove method will automatically find the IToolbarItem::Command in the CommandPool and decrement the ICommandPool::UsageCount by 1. If the  ICommandPool::UsageCount reaches 0 the command will be released from the CommandPool.

See Also

IToolbarControl Interface