menu

WinForms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class ComboBoxBarItem - WindowsForms API Reference | Syncfusion

    Show / Hide Table of Contents

    Class ComboBoxBarItem

    Represents a bar item that provides the combo box functionality in the XP Menus framework.

    Inheritance
    System.Object
    BarItem
    BarItemEx
    ComboBoxBarItem
    Implements
    IChangeNotifyingItem
    System.ComponentModel.ICustomTypeDescriptor
    IDataBindingSupport
    System.Runtime.Serialization.ISerializable
    IRequiresControl
    System.ICloneable
    IIgnoreWorkingArea
    System.ComponentModel.ISupportInitialize
    Inherited Members
    BarItem.AfterPopupItemPaint
    BarItem.BarName
    BarItem.BeforePopupItemPaint
    BarItem.CanDragDrop
    BarItem.CategoryIndex
    BarItem.Checked
    BarItem.Click
    BarItem.ContainmentChanged
    BarItem.CustomActiveTextColor
    BarItem.CustomDisabledTextColor
    BarItem.Customizable
    BarItem.CustomNormalTextColor
    BarItem.CustomTextFont
    BarItem.DataBindings
    BarItem.Designer
    BarItem.DesignMode
    BarItem.DisabledImage
    BarItem.DisabledImageIndex
    BarItem.DisabledImageList
    BarItem.DisabledImageListAdv
    BarItem.DisabledLargeImageList
    BarItem.DisabledLargeImageListAdv
    BarItem.Dispose(Boolean)
    BarItem.DoubleClick
    BarItem.DrawImageMirrored
    BarItem.DrawToolbarItem
    BarItem.Enabled
    BarItem.GetPropertiesToDisableInDesignTime()
    BarItem.GetState(Int32)
    BarItem.HighlightedImage
    BarItem.HighlightedImageIndex
    BarItem.HighlightImageList
    BarItem.HighlightImageListAdv
    BarItem.HighlightLargeImageList
    BarItem.HighlightLargeImageListAdv
    BarItem.IDataBindingSupport.PropertyNamePrefix
    BarItem.Image
    BarItem.ImageIndex
    BarItem.ImageList
    BarItem.ImageListAdv
    BarItem.ImageSize
    BarItem.ImageTransparentColor
    BarItem.IsDisposed
    BarItem.IsDisposing
    BarItem.IsRecentlyUsedItem
    BarItem.IsValidDisabledImageIndex
    BarItem.IsValidHighlightedImageIndex(Boolean)
    BarItem.IsValidPressedImageIndex(Boolean)
    BarItem.LargeImageList
    BarItem.LargeImageListAdv
    BarItem.Manager
    BarItem.MergeOrder
    BarItem.MergeType
    BarItem.MetroBackColor
    BarItem.MouseDown
    BarItem.MouseUp
    BarItem.OnAfterPopupItemPaint(PopupItemPaintEventArgs)
    BarItem.OnBeforePopupItemPaint(PopupItemPaintEventArgs)
    BarItem.OnCanDragDrop(CanDragDropEventArgs)
    BarItem.OnContainmentChanged(ContainmentChangedEventArgs)
    BarItem.OnDrawToolbarItem(DrawToolbarItemEventArgs)
    BarItem.OnItemClicked(EventArgs)
    BarItem.OnItemDoubleClicked(EventArgs)
    BarItem.OnItemMouseDown(MouseEventArgs)
    BarItem.OnItemMouseUp(MouseEventArgs)
    BarItem.OnPropertyChanged(SyncfusionPropertyChangedEventArgs)
    BarItem.OnProvideFontInfo(ProvideFontInfoEventArgs)
    BarItem.OnSelected(EventArgs)
    BarItem.OnShowTooltipChanged()
    BarItem.OnUnselected(EventArgs)
    BarItem.OnUpdateUI(EventArgs)
    BarItem.Padding
    BarItem.PaddingForThemesX
    BarItem.PaddingForThemesY
    BarItem.PaintStyle
    BarItem.PerformClick()
    BarItem.PerformDoubleClick()
    BarItem.PerformSelected()
    BarItem.PerformUnselected()
    BarItem.PerformUpdateUI()
    BarItem.PressedImageIndex
    BarItem.PressedImageList
    BarItem.PressedImageListAdv
    BarItem.PressedLargeImageList
    BarItem.PressedLargeImageListAdv
    BarItem.PropertyChanged
    BarItem.ProvideFontInfo
    BarItem.ReiseAfterPopupItemPaint(Graphics, Rectangle, Boolean, DrawElement, GridStyleInfo)
    BarItem.ReiseBeforePopupItemPaint(Graphics, Rectangle, Boolean, DrawElement, GridStyleInfo)
    BarItem.ResetCustomActiveTextColor()
    BarItem.ResetCustomDisabledTextColor()
    BarItem.ResetCustomNormalTextColor()
    BarItem.ResetDisabledImageList()
    BarItem.ResetDisabledLargeImageList()
    BarItem.ResetHighlightImageList()
    BarItem.ResetHighlightImageListAdv()
    BarItem.ResetHighlightLargeImageList()
    BarItem.ResetHighlightLargeImageListAdv()
    BarItem.ResetImageList()
    BarItem.ResetImageListAdv()
    BarItem.ResetImageSize()
    BarItem.ResetImageTransparentColor()
    BarItem.ResetLargeImageList()
    BarItem.ResetLargeImageListAdv()
    BarItem.ResetPressedImageList()
    BarItem.ResetPressedImageListAdv()
    BarItem.ResetPressedLargeImageList()
    BarItem.ResetPressedLargeImageListAdv()
    BarItem.ResetShortcutText()
    BarItem.ResizeGlyphToFit
    BarItem.Selected
    BarItem.SetState(Int32, Boolean)
    BarItem.Shortcut
    BarItem.ShortcutText
    BarItem.ShouldSerializeCustomActiveTextColor()
    BarItem.ShouldSerializeCustomDisabledTextColor()
    BarItem.ShouldSerializeCustomNormalTextColor()
    BarItem.ShouldSerializeDisabledImageList()
    BarItem.ShouldSerializeDisabledLargeImageList()
    BarItem.ShouldSerializeHighlightImageList()
    BarItem.ShouldSerializeHighlightImageListAdv()
    BarItem.ShouldSerializeHighlightLargeImageList()
    BarItem.ShouldSerializeHighlightLargeImageListAdv()
    BarItem.ShouldSerializeImageList()
    BarItem.ShouldSerializeImageListAdv()
    BarItem.ShouldSerializeImageSize()
    BarItem.ShouldSerializeImageTransparentColor()
    BarItem.ShouldSerializeLargeImageList()
    BarItem.ShouldSerializeLargeImageListAdv()
    BarItem.ShouldSerializePadding()
    BarItem.ShouldSerializePressedImageList()
    BarItem.ShouldSerializePressedImageListAdv()
    BarItem.ShouldSerializePressedLargeImageList()
    BarItem.ShouldSerializePressedLargeImageListAdv()
    BarItem.ShouldSerializeShortcutText()
    BarItem.ShowMnemonicUnderlinesAlways
    BarItem.ShowTooltip
    BarItem.ShowTooltipChanged
    BarItem.ShowToolTipInPopUp
    BarItem.SizeToFit
    BarItem.Tag
    BarItem.Text
    BarItem.TextAlignment
    BarItem.Tooltip
    BarItem.TopLevelForm
    BarItem.Unselected
    BarItem.UpdateUI
    BarItem.UpdateUIOnAppIdle
    BarItem.UpdateUIRequired
    BarItem.Visible
    BarItemEx.HandleDoubleClick
    Namespace: Syncfusion.Windows.Forms.Tools.XPMenus
    Assembly: Syncfusion.Tools.Windows.dll
    Syntax
    public class ComboBoxBarItem : BarItemEx, IChangeNotifyingItem, ICustomTypeDescriptor, IDataBindingSupport, ISerializable, IRequiresControl, ICloneable, IIgnoreWorkingArea, ISupportInitialize
    Remarks

    This item provides you the flat look combo-boxes in your menus and toolbars. The item can operate in either editable or listbox mode (controlled by the Editable property). The TextBoxValue represents the current Text in the text box selected by the user.

    When in list box mode, you can fill the ChoiceList with the choices you want to provide the user.

    When in editable mode, you can turn on AutoAppend which will make the framework track and persist the entries made by the user and automatically append them to the choice list in the drop-down. Turning on AutoAppend will ignore the entries you made in the ChoiceList. The entries made by the user will be stored in the registry for reuse across applications. This entry will be associated with a custom AutoAppend category ID which will be synthesized based on the ComboBoxBarItem's text and CategoryID property.

    When in editable mode, a Click event will be thrown when the user presses the Return key when in the TextBox or when the user selects an item from the drop-down. When in list box mode, an Click event will be thrown when the user selects an item from the drop-down list box.

    Use the MinWidth property to provide a minimum width the corresponding bar item should be drawn with. The actual width might be bigger than the provided MinWidth in some cases.

    Examples

    Take a look at our XPMenus samples under the Tools\Samples\Menus Package\ folder for usage example.

    Constructors

    ComboBoxBarItem()

    Creates a new instance of the ComboBoxBarItem class.

    Declaration
    public ComboBoxBarItem()

    ComboBoxBarItem(SerializationInfo, StreamingContext)

    Declaration
    protected ComboBoxBarItem(SerializationInfo info, StreamingContext context)
    Parameters
    Type Name Description
    System.Runtime.Serialization.SerializationInfo info
    System.Runtime.Serialization.StreamingContext context

    Properties

    AutoAppend

    Indicates whether to automatically append items entered by the user in the TextBox into the drop-down list.

    Declaration
    public bool AutoAppend { get; set; }
    Property Value
    Type Description
    System.Boolean

    True to turn on auto append; flase otherwise.

    Remarks

    This property will be used only when in editable mode.

    Changing this property will fire the PropertyChanged event.

    ChoiceList

    Returns the choice list for the user.

    Declaration
    public StringCollection ChoiceList { get; }
    Property Value
    Type Description
    System.Collections.Specialized.StringCollection

    A StringCollection representing the choices available to the user.

    Remarks

    This collection will be reset when you turn-on AutoAppend and when in editable mode.

    Changing this property will fire the PropertyChanged event.

    CloseOnClick

    Indicates whether the DropDown list should close when an item is selected.

    Declaration
    public virtual bool CloseOnClick { get; set; }
    Property Value
    Type
    System.Boolean

    Editable

    Indicates whether the user can edit the value in this item with a TextBox.

    Declaration
    public bool Editable { get; set; }
    Property Value
    Type Description
    System.Boolean

    True to let the user edit the value through a TextBox. False to draw this in list box mode.

    Changing this property will fire the PropertyChanged event.

    ID

    Declaration
    public override string ID { get; set; }
    Property Value
    Type
    System.String
    Overrides
    BarItem.ID

    IgnoreWorkingArea

    Declaration
    public bool IgnoreWorkingArea { get; set; }
    Property Value
    Type
    System.Boolean

    ListBox

    Gets or sets a custom ListBox in the combo's dropdown.

    Declaration
    public ListBox ListBox { get; set; }
    Property Value
    Type Description
    System.Windows.Forms.ListBox

    A ListBox instance. Default is null.

    Remarks

    The ListBox specified using this property will be used in the dropdown region of the combo. When no value is specified a default ListBox will be used.

    Changing this property will fire the PropertyChanged event.

    MaxDropDownItems

    Gets or sets the maximum number of items to be shown in the drop-down portion of the ComboBoxBarItem.

    Declaration
    public virtual int MaxDropDownItems { get; set; }
    Property Value
    Type Description
    System.Int32

    The maximum number of items in the drop-down portion. The minimum for this property is 1 and the maximum is 100.

    Exceptions
    Type Condition
    System.ArgumentException

    The maximum number is set less than one or greater than 100.

    MinDropDownWidth

    Gets or sets the width of the dropdown.

    Declaration
    public virtual int MinDropDownWidth { get; set; }
    Property Value
    Type Description
    System.Int32

    -1 indicates the dropdown width will be as wide as the combo. Default is -1. The width could be bigger if the combo's width is bigger.

    MinWidth

    Gets or sets the minimum width of this item when placed in a menu or toolbar.

    Declaration
    public virtual int MinWidth { get; set; }
    Property Value
    Type Description
    System.Int32

    The minimum width with which this item should be drawn.

    Remarks

    Changing this property will fire the PropertyChanged event.

    PersistAutoAppendList

    Gets or sets a value indicating whether to persist autoappend list when autoappend is true.

    Declaration
    public bool PersistAutoAppendList { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if [persist auto append list]; otherwise, false.

    PersistTextBoxValue

    Indicates whether the TextBoxValue should be persisted when the application is shutdown.

    Declaration
    public bool PersistTextBoxValue { get; set; }
    Property Value
    Type Description
    System.Boolean

    True to persist; false otherwise. Default is false.

    Remarks

    This property need not be set when AutoAppend is true. When AutoAppend is turned on, the latest value will be persisted automatically.

    TextBoxValue

    Gets or sets the value in the TextBox.

    Declaration
    public string TextBoxValue { get; set; }
    Property Value
    Type Description
    System.String

    The string representing the value in the TextBox.

    Remarks

    Changing this property will fire the PropertyChanged event.

    Methods

    BeginInit()

    Implementation of the System.ComponentModel.ISupportInitialize interface.

    Declaration
    public void BeginInit()

    Clone()

    Creates a clone of this ComboBoxBarItem instance.

    Declaration
    public override object Clone()
    Returns
    Type Description
    System.Object

    An object that has similar properties to this ComboBoxBarItem.

    Overrides
    BarItem.Clone()
    Remarks

    Creates a new instance of ComboBoxBarItem and calls the CopyTo(BarItem) method to copy over properties.

    CopyTo(BarItem)

    Copies the properties of this ComboBoxBarItem into the specified BarItem.

    Declaration
    public override void CopyTo(BarItem barItem)
    Parameters
    Type Name Description
    BarItem barItem

    The ComboBoxBarItem where the values should be copied to.

    Overrides
    BarItem.CopyTo(BarItem)
    Remarks

    This method will also call CopyTo(BarItem) to copy over base class properties.

    EndInit()

    Implementation of the System.ComponentModel.ISupportInitialize interface.

    Declaration
    public void EndInit()

    Focus()

    Sets input Focus to the control

    Declaration
    public void Focus()

    GetObjectData(SerializationInfo, StreamingContext)

    Declaration
    public override void GetObjectData(SerializationInfo info, StreamingContext context)
    Parameters
    Type Name Description
    System.Runtime.Serialization.SerializationInfo info
    System.Runtime.Serialization.StreamingContext context
    Overrides
    BarItem.GetObjectData(SerializationInfo, StreamingContext)

    OnBeginInit()

    Begins the initialization.

    Declaration
    protected virtual void OnBeginInit()

    OnEndInit()

    Indicates that the initialization is complete.

    Declaration
    protected virtual void OnEndInit()

    OnInitListBox(ComboBoxBarItemInitListBoxEventArgs)

    Raises the InitListBox event.

    Declaration
    public virtual void OnInitListBox(ComboBoxBarItemInitListBoxEventArgs e)
    Parameters
    Type Name Description
    ComboBoxBarItemInitListBoxEventArgs e

    An ComboBoxBarItemInitListBoxEventArgs that contains the event data.

    Remarks

    The OnInitListBox method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.

    Notes to Inheritors: When overriding OnInitListBox in a derived class, be sure to call the base class's OnInitListBox method so that registered delegates receive the event.

    OnTextBoxBound(TextBoxBoundEventArgs)

    Raises the TextBoxBound event.

    Declaration
    public virtual void OnTextBoxBound(TextBoxBoundEventArgs e)
    Parameters
    Type Name Description
    TextBoxBoundEventArgs e

    OnTextBoxValueChange(TextBoxValueChangeEventArgs)

    Raises the TextBoxValueChange event.

    Declaration
    public virtual void OnTextBoxValueChange(TextBoxValueChangeEventArgs e)
    Parameters
    Type Name Description
    TextBoxValueChangeEventArgs e

    Events

    DownClosed

    Occurs when combo dropdown is closed.

    Declaration
    public event EventHandler DownClosed
    Event Type
    Type
    System.EventHandler

    DownOpened

    Occurs when combo dropdown is opened.

    Declaration
    public event EventHandler DownOpened
    Event Type
    Type
    System.EventHandler

    InitListBox

    This event optionally lets you customize the listbox before it's drop down.

    Declaration
    public event ComboBoxBarItemInitListBoxEventHandler InitListBox
    Event Type
    Type
    ComboBoxBarItemInitListBoxEventHandler
    Remarks

    This event will be fired after the user clicks on the dropdown button and before the listbox is shown.

    Also if this combo is editable, then this event will also be fired when the user uses the keyboard to browse through the different items.

    TextBoxBound

    Lets handle the textBox inside the ComboBox.

    Declaration
    public event TextBoxBoundEventHandler TextBoxBound
    Event Type
    Type
    TextBoxBoundEventHandler

    TextBoxValueChange

    This event optionally lets TextBoxValue change.

    Declaration
    public event TextBoxValueChangeEventHandler TextBoxValueChange
    Event Type
    Type
    TextBoxValueChangeEventHandler

    TextBoxValueChanging

    Declaration
    public event TextBoxValueChangingEventHandler TextBoxValueChanging
    Event Type
    Type
    TextBoxValueChangingEventHandler

    Explicit Interface Implementations

    IRequiresControl.Value

    Declaration
    object IRequiresControl.Value { get; set; }
    Returns
    Type
    System.Object

    ICloneable.Clone()

    Declaration
    object ICloneable.Clone()
    Returns
    Type
    System.Object

    Implements

    IChangeNotifyingItem
    System.ComponentModel.ICustomTypeDescriptor
    IDataBindingSupport
    System.Runtime.Serialization.ISerializable
    IRequiresControl
    System.ICloneable
    IIgnoreWorkingArea
    System.ComponentModel.ISupportInitialize
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved