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


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

IToolbarPalette.MoveItem Method

Moves an item from one index to another.

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

startIndex is a parameter of type long finalIndex [in]
finalIndex is a parameter of type long

Product Availability

Available with ArcGIS Engine.

Description

Moves the item at the specified startIndex, to the position at the specified finalIndex. If no finalIndex is supplied the item is moved to the end of the ToolbarPalette.

Errors Returned

1023 800a03ff: The specified index is out of range

[C#]
//Get a toolbar item
IToolbarItem2 toolbarItem = axToolbarControl1.GetItem(0);
//Get thepalette from the item  
IToolbarPalette toolbarPalette = toolbarItem.Palette;
if (toolbarPalette == null) return; 
//Move the item
toolbarPalette.MoveItem(0, toolbarPalette.Count - 1);
[Visual Basic .NET]
'Get a toolbar item
Dim toolbarItem As IToolbarItem2
toolbarItem = AxToolbarControl1.GetItem(0)
'Get the palette from the item  
Dim toolbarPalette As IToolbarPalette
toolbarPalette = toolbarItem.Palette
If toolbarPalette Is Nothing Then Exit Sub
'Move the item
toolbarPalette.MoveItem(0, toolbarPalette.Count - 1)

See Also

IToolbarPalette Interface