バージョン

Insert(Int32,String) メソッド

指定したキーを持つ UltraExplorerBarItem を作成し、指定したインデックスでコレクションに挿入します。
シンタックス
'宣言
 
Public Overloads Function Insert( _
   ByVal index As Integer, _
   ByVal key As String _
) As UltraExplorerBarItem
public UltraExplorerBarItem Insert( 
   int index,
   string key
)

パラメータ

index
項目をコレクションに挿入するインデックス。
key
新しい項目のキー。

戻り値の型

新しく作成された UltraExplorerBarItem
使用例
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");
		}
参照