Show / Hide Table of Contents

Class ComboBox

Represents a selection control that combines a non-editable text box and a drop-down containing a list box that allows users to select an item from a list.

Inheritance
System.Object
DependencyObject
UIElement
FrameworkElement
Control
ItemsControl
Selector
ComboBox
Inherited Members
Selector.SelectionChanged
Selector.SelectedIndex
Selector.SelectedIndexProperty
Selector.SelectedItem
Selector.SelectedItemProperty
Selector.SelectedValue
Selector.SelectedValueProperty
Selector.SelectedValuePath
Selector.SelectedValuePathProperty
Selector.IsSynchronizedWithCurrentItem
Selector.IsSynchronizedWithCurrentItemProperty
Selector.HasItems
Selector.OnItemsSourceChanged(IEnumerable, IEnumerable)
Selector.PrepareContainerForItemOverride(DependencyObject, Object)
Selector.ClearContainerForItemOverride(DependencyObject, Object)
Selector.OnItemsChanged(NotifyCollectionChangedEventArgs)
Selector.GetIsSelectionActive(DependencyObject)
ItemsControl.Items
ItemsControl.ItemContainerGenerator
ItemsControl.ItemsPanel
ItemsControl.ItemsPanelProperty
ItemsControl.ItemsSource
ItemsControl.ItemsSourceProperty
ItemsControl.ItemTemplate
ItemsControl.ItemTemplateProperty
ItemsControl.DisplayMemberPath
ItemsControl.DisplayMemberPathProperty
ItemsControl.ItemContainerStyle
ItemsControl.ItemContainerStyleProperty
ItemsControl.UpdateItemsPanel(ItemsPanelTemplate)
ItemsControl.LogicalChildren
ItemsControl.GetItemsOwner(DependencyObject)
ItemsControl.ItemsControlFromItemContainer(DependencyObject)
ItemsControl.OnTextInput(TextCompositionEventArgs)
Control.EnableBaseControlHandlingOfVisualStates
Control.ManageIsEnabled(Boolean)
Control.Background
Control.BackgroundProperty
Control.BorderBrush
Control.BorderBrushProperty
Control.BorderThickness
Control.BorderThicknessProperty
Control.FontWeight
Control.FontWeightProperty
Control.FontStyle
Control.FontStyleProperty
Control.Foreground
Control.ForegroundProperty
Control.FontFamily
Control.FontFamilyProperty
Control.FontSize
Control.FontSizeProperty
Control.TextDecorations
Control.TextDecorationsProperty
Control.Padding
Control.PaddingProperty
Control.HorizontalContentAlignment
Control.HorizontalContentAlignmentProperty
Control.VerticalContentAlignment
Control.VerticalContentAlignmentProperty
Control.TabIndex
Control.TabIndexProperty
Control.IsTabStop
Control.IsTabStopProperty
Control.TabNavigation
Control.TabNavigationProperty
Control.Template
Control.TemplateProperty
Control.ApplyTemplate()
Control.GetTemplateChild(String)
Control.Focus()
Control.CreateDomElement(Object, Object)
Control.CharacterSpacingProperty
Control.CharacterSpacing
Control.FontStretchProperty
Control.FontStretch
Control.OnDrop(DragEventArgs)
Control.OnDragEnter(DragEventArgs)
Control.OnDragLeave(DragEventArgs)
Control.OnTextInputUpdate(TextCompositionEventArgs)
Control.MeasureOverride(Size)
Control.ArrangeOverride(Size)
FrameworkElement.LayoutUpdated
FrameworkElement.SizeChanged
FrameworkElement.ResourceLookupMode
FrameworkElement.StyleProperty
FrameworkElement.Style
FrameworkElement.DefaultStyleKeyProperty
FrameworkElement.DefaultStyleKey
FrameworkElement.OverridesDefaultStyleProperty
FrameworkElement.OverridesDefaultStyle
FrameworkElement.OnVisualParentChanged(DependencyObject)
FrameworkElement.VisualChildrenCount
FrameworkElement.GetVisualChild(Int32)
FrameworkElement.Parent
FrameworkElement.AddLogicalChild(Object)
FrameworkElement.RemoveLogicalChild(Object)
FrameworkElement.TemplatedParent
FrameworkElement.Resources
FrameworkElement.IsLoaded
FrameworkElement.SetBinding(DependencyProperty, BindingBase)
FrameworkElement.SetBinding(DependencyProperty, Binding)
FrameworkElement.GetBindingExpression(DependencyProperty)
FrameworkElement.Cursor
FrameworkElement.CursorProperty
FrameworkElement.FindName(String)
FrameworkElement.Name
FrameworkElement.NameProperty
FrameworkElement.DataContext
FrameworkElement.DataContextProperty
FrameworkElement.DataContextChanged
FrameworkElement.Triggers
FrameworkElement.FlowDirectionProperty
FrameworkElement.FlowDirection
FrameworkElement.LanguageProperty
FrameworkElement.Language
FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs)
FrameworkElement.Tag
FrameworkElement.TagProperty
FrameworkElement.LoadedEvent
FrameworkElement.Loaded
FrameworkElement.Unloaded
FrameworkElement.BindingValidationError
FrameworkElement.ContextMenuProperty
FrameworkElement.ContextMenu
FrameworkElement.ContextMenuOpening
FrameworkElement.ToolTipProperty
FrameworkElement.ToolTip
FrameworkElement.INTERNAL_OnDetachedFromVisualTree()
FrameworkElement.INTERNAL_OnAttachedToVisualTree()
FrameworkElement.Height
FrameworkElement.HeightProperty
FrameworkElement.Width
FrameworkElement.WidthProperty
FrameworkElement.HorizontalAlignment
FrameworkElement.HorizontalAlignmentProperty
FrameworkElement.VerticalAlignment
FrameworkElement.VerticalAlignmentProperty
FrameworkElement.Margin
FrameworkElement.MarginProperty
FrameworkElement.MinHeight
FrameworkElement.MinHeightProperty
FrameworkElement.MinWidth
FrameworkElement.MinWidthProperty
FrameworkElement.MaxHeight
FrameworkElement.MaxHeightProperty
FrameworkElement.MaxWidth
FrameworkElement.MaxWidthProperty
FrameworkElement.ActualWidthProperty
FrameworkElement.ActualWidth
FrameworkElement.ActualHeightProperty
FrameworkElement.ActualHeight
UIElement.TransformToVisual(UIElement)
UIElement.RenderSize
UIElement.DesiredSize
UIElement.InvalidateMeasure()
UIElement.InvalidateArrange()
UIElement.Measure(Size)
UIElement.Arrange(Rect)
UIElement.UpdateLayout()
UIElement.DragEnter
UIElement.DragLeave
UIElement.Drop
UIElement.DragOver
UIElement.CacheMode
UIElement.CacheModeProperty
UIElement.Projection
UIElement.ProjectionProperty
UIElement.VisualParent
UIElement.AddVisualChild(UIElement)
UIElement.RemoveVisualChild(UIElement)
UIElement.OnVisualChildrenChanged(DependencyObject, DependencyObject)
UIElement.XamlSourcePath
UIElement.ClipToBounds
UIElement.ClipToBoundsProperty
UIElement.ClipProperty
UIElement.Clip
UIElement.IsEnabledProperty
UIElement.IsEnabled
UIElement.IsEnabledChanged
UIElement.EffectProperty
UIElement.Effect
UIElement.RenderTransformProperty
UIElement.RenderTransform
UIElement.RenderTransformOriginProperty
UIElement.RenderTransformOrigin
UIElement.UseLayoutRounding
UIElement.UseLayoutRoundingProperty
UIElement.Visibility
UIElement.VisibilityProperty
UIElement.IsVisibleProperty
UIElement.IsVisible
UIElement.IsVisibleChanged
UIElement.OpacityProperty
UIElement.Opacity
UIElement.OpacityMaskProperty
UIElement.OpacityMask
UIElement.IsHitTestVisible
UIElement.IsHitTestVisibleProperty
UIElement.AllowDrop
UIElement.AllowDropProperty
UIElement.CaptureMouse()
UIElement.IsMouseCaptured
UIElement.ReleaseMouseCapture()
UIElement.AllowScrollOnTouchMove
UIElement.AllowScrollOnTouchMoveProperty
UIElement.AddHandler(RoutedEvent, Delegate, Boolean)
UIElement.RemoveHandler(RoutedEvent, Delegate)
UIElement.MouseMoveEvent
UIElement.MouseMove
UIElement.OnMouseMove(MouseEventArgs)
UIElement.MouseLeftButtonDownEvent
UIElement.MouseLeftButtonDown
UIElement.MouseRightButtonDownEvent
UIElement.MouseRightButtonDown
UIElement.OnMouseRightButtonDown(MouseButtonEventArgs)
UIElement.MouseWheelEvent
UIElement.MouseWheel
UIElement.OnMouseWheel(MouseWheelEventArgs)
UIElement.MouseLeftButtonUpEvent
UIElement.MouseLeftButtonUp
UIElement.OnMouseLeftButtonUp(MouseButtonEventArgs)
UIElement.MouseEnterEvent
UIElement.MouseEnter
UIElement.MouseLeaveEvent
UIElement.MouseLeave
UIElement.TextInputStartEvent
UIElement.TextInputStart
UIElement.OnTextInputStart(TextCompositionEventArgs)
UIElement.TextInputEvent
UIElement.TextInput
UIElement.TextInputUpdateEvent
UIElement.TextInputUpdate
UIElement.TappedEvent
UIElement.Tapped
UIElement.OnTapped(TappedRoutedEventArgs)
UIElement.MouseRightButtonUpEvent
UIElement.MouseRightButtonUp
UIElement.OnMouseRightButtonUp(MouseButtonEventArgs)
UIElement.KeyDownEvent
UIElement.KeyDown
UIElement.KeyUpEvent
UIElement.KeyUp
UIElement.OnKeyUp(KeyEventArgs)
UIElement.GotFocusEvent
UIElement.GotFocus
UIElement.LostFocusEvent
UIElement.LostFocus
UIElement.LostMouseCapture
UIElement.OnLostMouseCapture(MouseEventArgs)
UIElement.INTERNAL_AttachToDomEvents()
UIElement.INTERNAL_DetachFromDomEvents()
DependencyObject.GetValue(DependencyProperty)
DependencyObject.SetCurrentValue(DependencyProperty, Object)
DependencyObject.ReadLocalValue(DependencyProperty)
DependencyObject.SetValue(DependencyProperty, Object)
DependencyObject.SetValue(DependencyPropertyKey, Object)
DependencyObject.CoerceValue(DependencyProperty)
DependencyObject.Dispatcher
DependencyObject.ClearValue(DependencyProperty)
DependencyObject.ClearValue(DependencyPropertyKey)
DependencyObject.CheckAccess()
DependencyObject.GetAnimationBaseValue(DependencyProperty)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: System.Windows.Controls
Assembly: OpenSilver.dll
Syntax
[TemplatePart(Name = "ContentPresenter", Type = typeof(ContentPresenter))]
[TemplatePart(Name = "Popup", Type = typeof(Popup))]
[TemplatePart(Name = "ContentPresenterBorder", Type = typeof(FrameworkElement))]
[TemplatePart(Name = "DropDownToggle", Type = typeof(ToggleButton))]
[TemplatePart(Name = "ScrollViewer", Type = typeof(ScrollViewer))]
public class ComboBox : Selector, IControl, IFrameworkElement, IUIElement, IDependencyObject

Constructors

| Improve this Doc View Source

ComboBox()

Initializes a new instance of the ComboBox class.

Declaration
public ComboBox()

Fields

| Improve this Doc View Source

IsDropDownOpenProperty

Identifies the IsDropDownOpen dependency property.

Declaration
public static readonly DependencyProperty IsDropDownOpenProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

IsSelectionActiveProperty

Identifies the IsSelectionActive attached property.

Declaration
public static readonly DependencyProperty IsSelectionActiveProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

MaxDropDownHeightProperty

Identifies the MaxDropDownHeight dependency property.

Declaration
public static readonly DependencyProperty MaxDropDownHeightProperty
Field Value
Type Description
DependencyProperty

Properties

| Improve this Doc View Source

HandlesScrolling

Gets a value that indicates whether a control supports scrolling.

Declaration
protected override bool HandlesScrolling { get; }
Property Value
Type Description
System.Boolean

true if the control has a ScrollViewer in its style and has a custom keyboard scrolling behavior; otherwise, false.

Overrides
Control.HandlesScrolling
| Improve this Doc View Source

IsDropDownOpen

Gets or sets a value that indicates whether the drop-down portion of the ComboBox is currently open.

Declaration
public bool IsDropDownOpen { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

IsEditable

Gets a value that indicates whether the user can edit text in the text box portion of the ComboBox. This property always returns false.

Declaration
public bool IsEditable { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

IsSelectionBoxHighlighted

Gets a value that indicates whether the SelectionBoxItem component is highlighted.

Declaration
[NotImplemented]
public bool IsSelectionBoxHighlighted { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

MaxDropDownHeight

Gets or sets the maximum height for a combo box drop-down.

Declaration
public double MaxDropDownHeight { get; set; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

SelectionBoxItem

Gets the item displayed in the selection box.

Declaration
public object SelectionBoxItem { get; }
Property Value
Type Description
System.Object
| Improve this Doc View Source

SelectionBoxItemTemplate

Gets the template applied to the selection box content.

Declaration
public DataTemplate SelectionBoxItemTemplate { get; }
Property Value
Type Description
DataTemplate

Methods

| Improve this Doc View Source

GetContainerForItemOverride()

Declaration
protected override DependencyObject GetContainerForItemOverride()
Returns
Type Description
DependencyObject
Overrides
ItemsControl.GetContainerForItemOverride()
| Improve this Doc View Source

IsItemItsOwnContainerOverride(Object)

Declaration
protected override bool IsItemItsOwnContainerOverride(object item)
Parameters
Type Name Description
System.Object item
Returns
Type Description
System.Boolean
Overrides
ItemsControl.IsItemItsOwnContainerOverride(Object)
| Improve this Doc View Source

OnApplyTemplate()

Declaration
public override void OnApplyTemplate()
Overrides
Selector.OnApplyTemplate()
| Improve this Doc View Source

OnCreateAutomationPeer()

Returns a ComboBoxAutomationPeer for use by the Silverlight automation infrastructure.

Declaration
protected override AutomationPeer OnCreateAutomationPeer()
Returns
Type Description
AutomationPeer

A ComboBoxAutomationPeer for the ComboBox object.

Overrides
UIElement.OnCreateAutomationPeer()
| Improve this Doc View Source

OnDropDownClosed(EventArgs)

Invoked when the DropDownClosed event is raised.

Declaration
protected virtual void OnDropDownClosed(EventArgs e)
Parameters
Type Name Description
System.EventArgs e

Event data for the event.

| Improve this Doc View Source

OnDropDownOpened(EventArgs)

Invoked when the DropDownOpened event is raised.

Declaration
protected virtual void OnDropDownOpened(EventArgs e)
Parameters
Type Name Description
System.EventArgs e

Event data for the event.

| Improve this Doc View Source

OnGotFocus(RoutedEventArgs)

Provides handling for the GotFocus event.

Declaration
protected override void OnGotFocus(RoutedEventArgs e)
Parameters
Type Name Description
RoutedEventArgs e

The event data.

Overrides
Control.OnGotFocus(RoutedEventArgs)
| Improve this Doc View Source

OnKeyDown(KeyEventArgs)

Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
Type Name Description
KeyEventArgs e
Overrides
UIElement.OnKeyDown(KeyEventArgs)
| Improve this Doc View Source

OnLostFocus(RoutedEventArgs)

Provides handling for the LostFocus event.

Declaration
protected override void OnLostFocus(RoutedEventArgs e)
Parameters
Type Name Description
RoutedEventArgs e

The event data.

Overrides
Control.OnLostFocus(RoutedEventArgs)
| Improve this Doc View Source

OnMouseEnter(MouseEventArgs)

Provides handling for the MouseEnter event that occurs when the mouse pointer enters this control.

Declaration
protected override void OnMouseEnter(MouseEventArgs e)
Parameters
Type Name Description
MouseEventArgs e

The event data.

Overrides
UIElement.OnMouseEnter(MouseEventArgs)
| Improve this Doc View Source

OnMouseLeave(MouseEventArgs)

Provides handling for the MouseLeave event that occurs when the mouse pointer leaves the combo box.

Declaration
protected override void OnMouseLeave(MouseEventArgs e)
Parameters
Type Name Description
MouseEventArgs e

The event data.

Overrides
UIElement.OnMouseLeave(MouseEventArgs)
| Improve this Doc View Source

OnMouseLeftButtonDown(MouseButtonEventArgs)

Provides handling for the MouseLeftButtonDown event that occurs when the left mouse button is pressed while the mouse pointer is over the combo box.

Declaration
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
Parameters
Type Name Description
MouseButtonEventArgs e

The event data.

Overrides
UIElement.OnMouseLeftButtonDown(MouseButtonEventArgs)
| Improve this Doc View Source

OnSelectionChanged(SelectionChangedEventArgs)

Raises the SelectionChanged event

Declaration
protected override void OnSelectionChanged(SelectionChangedEventArgs e)
Parameters
Type Name Description
SelectionChangedEventArgs e

The arguments for the event.

Overrides
Selector.OnSelectionChanged(SelectionChangedEventArgs)

Events

| Improve this Doc View Source

DropDownClosed

Occurs when the drop-down portion of the ComboBox closes.

Declaration
public event EventHandler DropDownClosed
Event Type
Type Description
System.EventHandler
| Improve this Doc View Source

DropDownOpened

Occurs when the drop-down portion of the ComboBox opens.

Declaration
public event EventHandler DropDownOpened
Event Type
Type Description
System.EventHandler

Extension Methods

DependencyObjectHelper.GetSelfAndAncestors(DependencyObject)
UIElementExtendedRoutedEventExtensions.AddHandler(UIElement, ExtendedRoutedEvent, Delegate, Boolean)
UIElementExtendedRoutedEventExtensions.RemoveHandler(UIElement, ExtendedRoutedEvent, Delegate)
ItemsControlExtensions.GetItemsHost(ItemsControl)
ItemsControlExtensions.GetScrollHost(ItemsControl)
ItemsControlExtensions.GetContainers(ItemsControl)
ItemsControlExtensions.GetContainers<TContainer>(ItemsControl)
ItemsControlExtensions.GetItemsAndContainers(ItemsControl)
ItemsControlExtensions.GetItemsAndContainers<TContainer>(ItemsControl)
VisualTreeExtensions.GetVisualAncestors(DependencyObject)
VisualTreeExtensions.GetVisualAncestorsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualChildren(DependencyObject)
VisualTreeExtensions.GetVisualChildrenAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualDescendants(DependencyObject)
VisualTreeExtensions.GetVisualDescendantsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualSiblings(DependencyObject)
VisualTreeExtensions.GetVisualSiblingsAndSelf(DependencyObject)
VisualTreeExtensions.GetBoundsRelativeTo(FrameworkElement, UIElement)
VisualTreeExtensions.InvokeOnLayoutUpdated(FrameworkElement, Action)
  • Improve this Doc
  • View Source