Version

SelectedIndex Property

Returns or sets the zero-based index of the selected item in the ValueList.
Syntax
'Declaration
 
Public Property SelectedIndex As Integer
public int SelectedIndex {get; set;}
Remarks

When an item is selected from the drop-down portion of the combo, that item's index in the ValueList is assigned to the SelectedIndex property.

Example
The following code creates a toolbar, LabelTool and ComboBoxTool and places the label and combobox on the toolbar.

Imports System.Diagnostics
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinToolbars

	Private Sub Button18_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button18.Click

		' ----------------------------------------------------------------------------
		' Create a toolbars and add it to the UltraToolbarManager's toolbars collection.
		Me.UltraToolbarsManager1.Toolbars.AddToolbar("GreatComposers")


		' ----------------------------------------------------------------------------
		' Create a ComboBoxTool and LabelTool and add them to the toolbar.
		Dim comboBoxTool As New ComboBoxTool("GreatComposersList")
		Dim labelTool As New LabelTool("GreatComposersLabel")

		' Always add new tools to the UltraToolbarManager's root tools collection
		' before adding them to menus or toolbars.
		Me.UltraToolbarsManager1.Tools.AddRange(New ToolBase() {comboBoxTool, labelTool})

		' Add the tools to the toolbar.
		Me.UltraToolbarsManager1.Toolbars("GreatComposers").Tools.AddTool("GreatComposersLabel")
		Me.UltraToolbarsManager1.Toolbars("GreatComposers").Tools.AddTool("GreatComposersList")


		' ----------------------------------------------------------------------------
		' Set the label's caption and right-justify the text.
		LabelTool.SharedProps.Caption = "Select Composer"
		LabelTool.SharedProps.AppearancesSmall.Appearance.FontData.Bold = DefaultableBoolean.True
		LabelTool.SharedProps.AppearancesSmall.Appearance.TextHAlign = HAlign.Right


		' ----------------------------------------------------------------------------
		' Add some entries to the combobox.
		comboBoxTool.ValueList.ValueListItems.Add("Mozart")
		comboBoxTool.ValueList.ValueListItems.Add("Beethoven")
		comboBoxTool.ValueList.ValueListItems.Add("Bach")
		comboBoxTool.ValueList.ValueListItems.Add("Vivaldi")
		comboBoxTool.SelectedIndex = 0
		comboBoxTool.DropDownStyle = DropDownStyle.DropDown
		comboBoxTool.Value = "<Select a comnposer>"
		comboBoxTool.SharedProps.ToolTipText = "Great Composers"
		comboBoxTool.AutoComplete = True

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

		private void button18_Click(object sender, System.EventArgs e)
		{

			// ----------------------------------------------------------------------------
			// Create a toolbars and add it to the UltraToolbarManager's toolbars collection.
			this.ultraToolbarsManager1.Toolbars.AddToolbar("GreatComposers");


			// ----------------------------------------------------------------------------
			// Create a ComboBoxTool and LabelTool and add them to the toolbar.
			ComboBoxTool comboBoxTool	= new ComboBoxTool("GreatComposersList");
			LabelTool	 labelTool		= new LabelTool("GreatComposersLabel");

			// Always add new tools to the UltraToolbarManager's root tools collection
			// before adding them to menus or toolbars.
			this.ultraToolbarsManager1.Tools.AddRange(new ToolBase [] { comboBoxTool, labelTool } );

			// Add the tools to the toolbar.
			this.ultraToolbarsManager1.Toolbars["GreatComposers"].Tools.AddTool("GreatComposersLabel");
			this.ultraToolbarsManager1.Toolbars["GreatComposers"].Tools.AddTool("GreatComposersList");


			// ----------------------------------------------------------------------------
			// Set the label's caption and right-justify the text.
			labelTool.SharedProps.Caption	= "Select Composer";
			labelTool.SharedProps.AppearancesSmall.Appearance.FontData.Bold = DefaultableBoolean.True;
			labelTool.SharedProps.AppearancesSmall.Appearance.TextHAlign	= HAlign.Right;


			// ----------------------------------------------------------------------------
			// Add some entries to the combobox and set some properties.
			comboBoxTool.ValueList.ValueListItems.Add("Mozart");
			comboBoxTool.ValueList.ValueListItems.Add("Beethoven");
			comboBoxTool.ValueList.ValueListItems.Add("Bach");
			comboBoxTool.ValueList.ValueListItems.Add("Vivaldi");
			comboBoxTool.SelectedIndex		= 0;
			comboBoxTool.DropDownStyle		= DropDownStyle.DropDownList;
			comboBoxTool.Value			= "<Select a comnposer>";
			comboBoxTool.SharedProps.ToolTipText	= "Great Composers";
			comboBoxTool.AutoComplete		= true;

		}
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