method SwimLane.ToolBarReplaceIcon ([Icon as Variant], [Index as Variant])
Adds a new icon, replaces an icon or clears the toolbar's image list.

TypeDescription
Icon as Variant A long expression that indicates the icon's handle. By default, the Icon parameter is 0, if it is missing.
Index as Variant A long expression that indicates the index where icon is inserted. By default, the Index parameter is -1, if it is missing.
ReturnDescription
LongA long expression that indicates the index of the icon in the images collection
Use the ToolBarReplaceIcon property to add, remove or replace an icon in the toolbar's images collection. Also, the ToolBarReplaceIcon property can clear the toolbar's images collection. Use the ToolBarImages method to attach an image list to the toolbar.

The following sample shows how to add a new icon to toolbar's images list:

i = SwimLane1.ToolBarReplaceIcon( LoadPicture("d:\icons\help.ico").Handle), in this case the i specifies the index where the icon was added

The following sample shows how to replace an icon into toolbar's images list::

i = SwimLane1.ToolBarReplaceIcon( LoadPicture("d:\icons\help.ico").Handle, 0), in this case the i is zero, because the first icon was replaced.

The following sample shows how to remove an icon from toolbar's images list:

SwimLane1.ToolBarReplaceIcon 0, i, in this case the i must be the index of the icon that follows to be removed

The following sample shows how to clear the toolbar's icons collection:

SwimLane1.ToolBarReplaceIcon 0, -1