Version

Insert(Int32,String,String) Method

Creates and inserts an UltraExplorerBarItem into the collection at the specified index with the specified key and text.
Syntax
'Declaration
 
Public Overloads Function Insert( _
   ByVal index As Integer, _
   ByVal key As String, _
   ByVal text As String _
) As UltraExplorerBarItem
public UltraExplorerBarItem Insert( 
   int index,
   string key,
   string text
)

Parameters

index
The index at which to insert the item.
key
The key of the new item.
text
The text of the new item.

Return Value

The newly-created UltraExplorerBarItem.
Example
The following code shows how to use the various overloads of the Items colllection Insert Method.

Imports System.Diagnostics
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinExplorerBar


	Private Sub Button86_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button86.Click

		' Insert items into the Items collection using the different overloads.


		' Can't proceed unless we have at least 1 group.
		If (Me.ultraExplorerBar1.Groups.Count < 1) Then
			Return
		End If


		' Items.Insert(int index)
		Dim item As UltraExplorerBarItem = Me.ultraExplorerBar1.Groups(0).Items.Insert(0)
		item.Text = "FirstItemAdded"


		' Items.Insert(int index, UltraExplorerBarItem item)
		item = New UltraExplorerBarItem("SecondItemKey")
		item.Text = "SecondItemAdded"

		Me.ultraExplorerBar1.Groups(0).Items.Insert(0, item)


		' Items.Insert(string Key, string Text)
		item = Me.ultraExplorerBar1.Groups(0).Items.Insert(0, "ThirdItemKey", "ThirdItem")


		' Items.Insert(string Key)
		item = Me.ultraExplorerBar1.Groups(0).Items.Insert(0, "FourthItemKey")

	End Sub
using System.Diagnostics;
using Infragistics.Win;
using Infragistics.Win.UltraWinExplorerBar;


		private void button86_Click(object sender, System.EventArgs e)
		{
			// Insert items into the Items collection using the different overloads.


			// Can't proceed unless we have at least 1 group.
			if (this.ultraExplorerBar1.Groups.Count < 1)
				return;


			// Items.Insert(int index)
			UltraExplorerBarItem item = this.ultraExplorerBar1.Groups[0].Items.Insert(0);
			item.Text = "FirstItemAdded";


			// Items.Insert(int index, UltraExplorerBarItem item)
			item		= new UltraExplorerBarItem("SecondItemKey");
			item.Text	= "SecondItemAdded";

			this.ultraExplorerBar1.Groups[0].Items.Insert(0, item);


			// Items.Insert(string Key, string Text)
			item = this.ultraExplorerBar1.Groups[0].Items.Insert(0, "ThirdItemKey", "ThirdItem");


			// Items.Insert(string Key)
			item = this.ultraExplorerBar1.Groups[0].Items.Insert(0, "FourthItemKey");
		}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also