'Declaration Public Class ComboBoxTool Inherits TextBoxTool Implements Infragistics.Shared.IKeyedSubObject, Infragistics.Shared.IKeyedSubObjectEx, Infragistics.Win.Notifications.INotificationBadgeProvider, Infragistics.Win.Notifications.INotificationBadgeSettingsOwner
public class ComboBoxTool : TextBoxTool, Infragistics.Shared.IKeyedSubObject, Infragistics.Shared.IKeyedSubObjectEx, Infragistics.Win.Notifications.INotificationBadgeProvider, Infragistics.Win.Notifications.INotificationBadgeSettingsOwner
To force the Value of the ComboBoxTool to be one of the items in its list, set the DropDownStyle to DropDownList. Otherwise, to let custom input to be entered into the combo box with the keyboard, set DropDownStyle to DropDown.
To be notified when an instance of the ComboBoxTool has its Value changed, handle the ToolValueChanged event of the ComboBoxTool. To be notified when any instance of all ComboBoxTools with the same Key has its Value changed, handle the UltraToolbarsManager.ToolValueChanged event and check the Key of the tool passed into the event arguments.
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; }
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