'Declaration Public Overridable ReadOnly Property Items As Infragistics.Win.ValueListItemsCollection
public virtual Infragistics.Win.ValueListItemsCollection Items {get;}
The Items collection is a collection of type Infragistics.Win.ValueListItemsCollection.
The items in the list portion of the control are objects of type Infragistics.Win.ValueListItem. A ValueListItem has both a data value and display text, so that the text displayed by the item can be independent of the value that the item represents.
When a ValueListItem has no specific display text set, the string representation of its data value is displayed. When items are selected from the dropdown list, the control's SelectedItem property is set to that item. The SelectedIndex property is also set to the index of that item.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Add 8 items to the combo Me.UltraComboEditor1.Items.Add(1, "One") Me.UltraComboEditor1.Items.Add(2, "Two") Me.UltraComboEditor1.Items.Add(3, "Three") Me.UltraComboEditor1.Items.Add(4, "Four") Me.UltraComboEditor1.Items.Add(5, "Five") Me.UltraComboEditor1.Items.Add(6, "Six") Me.UltraComboEditor1.Items.Add(7, "Seven") Me.UltraComboEditor1.Items.Add(8, "Eight") ' This combo should always be in edit mode, Me.UltraComboEditor1.AlwaysInEditMode = True ' Turn on auto-complete for Internet Explorer type auto completion Me.UltraComboEditor1.AutoComplete = True ' Office XP look and feel. Me.UltraComboEditor1.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.OfficeXP ' Assign a shared image and forecolor to each element. Me.UltraComboEditor1.ItemAppearance.Image = Me.Icon.ToBitmap() Me.UltraComboEditor1.ImageTransparentColor = Color.FromArgb(192, 192, 192) Me.UltraComboEditor1.ItemAppearance.ForeColor = Color.White ' Assign individual backColors to each element Dim baseColorIndex As Integer = 255 / Me.UltraComboEditor1.Items.Count Dim i As Integer For i = 0 To Me.UltraComboEditor1.Items.Count - 1 Me.UltraComboEditor1.Items(i).Appearance.BackColor = Color.FromArgb(100, 100, baseColorIndex + (baseColorIndex * i)) Next i Me.UltraComboEditor1.MaxDropDownItems = 6 Me.UltraComboEditor1.HasMRUList = True Me.UltraComboEditor1.SelectedIndex = 3 Me.UltraComboEditor1.SortStyle = Infragistics.Win.ValueListSortStyle.DescendingByValue End Sub
private void Form1_Load(object sender, System.EventArgs e) { // Add 8 items to the combo this.ultraComboEditor1.Items.Add(1,"One"); this.ultraComboEditor1.Items.Add(2,"Two"); this.ultraComboEditor1.Items.Add(3,"Three"); this.ultraComboEditor1.Items.Add(4,"Four"); this.ultraComboEditor1.Items.Add(5,"Five"); this.ultraComboEditor1.Items.Add(6,"Six"); this.ultraComboEditor1.Items.Add(7,"Seven"); this.ultraComboEditor1.Items.Add(8,"Eight"); // This combo should always be in edit mode, this.ultraComboEditor1.AlwaysInEditMode = true; // Turn on auto-complete for Internet Explorer type auto completion this.ultraComboEditor1.AutoComplete = true; // Office XP look and feel. this.ultraComboEditor1.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.OfficeXP; // Assign a shared image and forecolor to each element. this.ultraComboEditor1.ItemAppearance.Image = this.Icon.ToBitmap(); this.ultraComboEditor1.ImageTransparentColor = Color.FromArgb(192,192,192); this.ultraComboEditor1.ItemAppearance.ForeColor = Color.White; // Assign individual backColors to each element int baseColorIndex = 255 / this.ultraComboEditor1.Items.Count; for(int i = 0; i < this.ultraComboEditor1.Items.Count; i++) { this.ultraComboEditor1.Items[i].Appearance.BackColor = Color.FromArgb(100,100,baseColorIndex + (baseColorIndex * i)); } this.ultraComboEditor1.MaxDropDownItems = 6; this.ultraComboEditor1.HasMRUList = true; this.ultraComboEditor1.SelectedIndex = 3; this.ultraComboEditor1.SortStyle = Infragistics.Win.ValueListSortStyle.DescendingByValue; }
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