Version

Add(UltraExplorerBarItem) Method

Adds the specified UltraExplorerBarItem to the collection.
Syntax
'Declaration
 
Public Overloads Function Add( _
   ByVal item As UltraExplorerBarItem _
) As Integer
public int Add( 
   UltraExplorerBarItem item
)

Parameters

item

Return Value

The index at which the item was added.
Example
The following code shows how to use the various overloads of the items colllection Add Method.

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


	Private Sub Button88_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button88.Click

		' Add items to 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.Add()
		Dim item As UltraExplorerBarItem = Me.ultraExplorerBar1.Groups(0).Items.Add()

		item.Text = "FirstItemAdded"


		' Items.Add(UltraExplorerBarItem item)
		item = New UltraExplorerBarItem("SecondItemKey")
		item.Text = "SecondItemAdded"

		Dim index As Integer = Me.ultraExplorerBar1.Groups(0).Items.Add(item)


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


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


		' Items.Add(string Key)
		Dim item1 As UltraExplorerBarItem = New UltraExplorerBarItem()
		Dim item2 As UltraExplorerBarItem = New UltraExplorerBarItem()
		Dim item3 As UltraExplorerBarItem = New UltraExplorerBarItem()
		Dim item4 As UltraExplorerBarItem = New UltraExplorerBarItem()

		Me.ultraExplorerBar1.Groups(0).Items.AddRange(New UltraExplorerBarItem() {item1, item2, item3, item4})

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


		private void button88_Click(object sender, System.EventArgs e)
		{
			// Add items to 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.Add()
			UltraExplorerBarItem item = this.ultraExplorerBar1.Groups[0].Items.Add();

			item.Text = "FirstItemAdded";


			// Items.Add(UltraExplorerBarItem item)
			item		= new UltraExplorerBarItem("SecondItemKey");
			item.Text	= "SecondItemAdded";

			int index	= this.ultraExplorerBar1.Groups[0].Items.Add(item);


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


			// Items.Add(string Key)
			item = this.ultraExplorerBar1.Groups[0].Items.Add("FourthItemKey");


			// Items.Add(string Key)
			UltraExplorerBarItem item1	= new UltraExplorerBarItem();
			UltraExplorerBarItem item2	= new UltraExplorerBarItem();
			UltraExplorerBarItem item3	= new UltraExplorerBarItem();
			UltraExplorerBarItem item4	= new UltraExplorerBarItem();
			this.ultraExplorerBar1.Groups[0].Items.AddRange(new UltraExplorerBarItem [] { item1, item2, item3, item4 } );
		}
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