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
Inherited Members
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 SourceComboBox()
Initializes a new instance of the ComboBox class.
Declaration
public ComboBox()
Fields
| Improve this Doc View SourceIsDropDownOpenProperty
Identifies the IsDropDownOpen dependency property.
Declaration
public static readonly DependencyProperty IsDropDownOpenProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
IsSelectionActiveProperty
Identifies the IsSelectionActive attached property.
Declaration
public static readonly DependencyProperty IsSelectionActiveProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
MaxDropDownHeightProperty
Identifies the MaxDropDownHeight dependency property.
Declaration
public static readonly DependencyProperty MaxDropDownHeightProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
Properties
| Improve this Doc View SourceHandlesScrolling
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
| Improve this Doc View SourceIsDropDownOpen
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 |
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 |
IsSelectionBoxHighlighted
Gets a value that indicates whether the SelectionBoxItem component is highlighted.
Declaration
[NotImplemented]
public bool IsSelectionBoxHighlighted { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
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 |
SelectionBoxItem
Gets the item displayed in the selection box.
Declaration
public object SelectionBoxItem { get; }
Property Value
Type | Description |
---|---|
System.Object |
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 SourceGetContainerForItemOverride()
Declaration
protected override DependencyObject GetContainerForItemOverride()
Returns
Type | Description |
---|---|
DependencyObject |
Overrides
| Improve this Doc View SourceIsItemItsOwnContainerOverride(Object)
Declaration
protected override bool IsItemItsOwnContainerOverride(object item)
Parameters
Type | Name | Description |
---|---|---|
System.Object | item |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
| Improve this Doc View SourceOnApplyTemplate()
Declaration
public override void OnApplyTemplate()
Overrides
| Improve this Doc View SourceOnCreateAutomationPeer()
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
| Improve this Doc View SourceOnDropDownClosed(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. |
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. |
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
| Improve this Doc View SourceOnKeyDown(KeyEventArgs)
Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
KeyEventArgs | e |
Overrides
| Improve this Doc View SourceOnLostFocus(RoutedEventArgs)
Provides handling for the LostFocus event.
Declaration
protected override void OnLostFocus(RoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
RoutedEventArgs | e | The event data. |
Overrides
| Improve this Doc View SourceOnMouseEnter(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
| Improve this Doc View SourceOnMouseLeave(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
| Improve this Doc View SourceOnMouseLeftButtonDown(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
| Improve this Doc View SourceOnSelectionChanged(SelectionChangedEventArgs)
Raises the SelectionChanged event
Declaration
protected override void OnSelectionChanged(SelectionChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
SelectionChangedEventArgs | e | The arguments for the event. |
Overrides
Events
| Improve this Doc View SourceDropDownClosed
Occurs when the drop-down portion of the ComboBox closes.
Declaration
public event EventHandler DropDownClosed
Event Type
Type | Description |
---|---|
System.EventHandler |
DropDownOpened
Occurs when the drop-down portion of the ComboBox opens.
Declaration
public event EventHandler DropDownOpened
Event Type
Type | Description |
---|---|
System.EventHandler |