'宣言 Public Overloads Function Insert( _ ByVal index As Integer, _ ByVal key As String _ ) As UltraExplorerBarItem
public UltraExplorerBarItem Insert( int index, string key )
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"); }