Returns the index of the first item containing the given command. Returns -1 if it is not found.
[Visual Basic .NET] Public Function Find ( _ ByVal item As Object _ ) As Integer
[C#] public int Find ( object item );
[C++]
HRESULT Find(
VARIANT item,
long* pVal
);
[C++]Parameters
item [in] item is a parameter of type VARIANT pVal [out, retval] pVal is a parameter of type long
Product Availability
Available with ArcGIS Engine.
Description
Returns the index of the first item on the ToolbarPalette using the specified IUid, ProgID, ICommand. If the specified command cannot be found -1 is returned.
Remarks
To find an Item on the ToolbarPalette using a Command implementing ICommandSubType pass a UID with its SubType property set.
[C#]
longlindex; UID uID;//Get a toolbar itemIToolbarItem2 toolbarItem = (IToolbarItem2) axToolbarControl1.GetItem(0);//Get the palette from the itemIToolbarPalette toolbarPalette = toolbarItem.Palette;if(toolbarPalette ==null) return;//Find an Item on the palette by passing a ProgIDlIndex = toolbarPalette.Find("esriControls.ControlsMapZoomInTool");//Find an Item on the palette by passing a UIDuID =newUIDClass(); uID.Value = "esriControls.ControlsMapZoomInTool"; lIndex = toolbarPalette.Find(uID);//Find an Item on the palette by passing a UID with subtype setuID =newUIDClass(); uID.Value = "esriControls.ControlsInkHighlightTool"; uID.SubType = 2; lIndex = toolbarPalette.Find(uID);
[Visual Basic .NET]
DimlIndexAs Long, uIDAsUID'Get a toolbar itemDimtoolbarItemAsIToolbarItem2 toolbarItem = AxToolbarControl1.GetItem(0)'Get the palette from the itemDimtoolbarPaletteAsIToolbarPalette toolbarPalette = toolbarItem.PaletteIftoolbarPaletteIs Nothing Then Exit Sub'Find an Item on the palette by passing a ProgIDlIndex = toolbarPalette.Find("esriControls.ControlsMapZoomInTool")'Find an Item on the palette by passing a UIDuID =NewUIDClass uID.Value = "esriControls.ControlsMapZoomInTool" lIndex = toolbarPalette.Find(uID)'Find an Item on the palette by passing a UID with subtype setuID =NewUIDClass uID.Value = "esriControls.ControlsInkHighlightTool" uID.SubType = 2 lIndex = toolbarPalette.Find(uID)