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
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 |
MaxDropDownHeightProperty
Identifies the MaxDropDownHeight dependency property.
Declaration
public static readonly DependencyProperty MaxDropDownHeightProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
Properties
| 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 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. |
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
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 |