# ComboBox

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls/struct-combobox/

**struct** · [`ferroui-controls`](/docs/0.5.0/api/ferroui-controls/) · v0.5.0

```rust
struct ComboBox
```

A drop-down list control.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/combo_box.rs#L48)

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`TEMPLATE_PARTS`](#assoc_const-template_parts)
- [`PSEUDO_CLASSES`](#assoc_const-pseudo_classes)
- [`is_drop_down_open_property`](#function-is_drop_down_open_property)
- [`is_editable_property`](#function-is_editable_property)
- [`max_drop_down_height_property`](#function-max_drop_down_height_property)
- [`selection_box_item_property`](#function-selection_box_item_property)
- [`placeholder_text_property`](#function-placeholder_text_property)
- [`placeholder_foreground_property`](#function-placeholder_foreground_property)
- [`horizontal_content_alignment_property`](#function-horizontal_content_alignment_property)
- [`vertical_content_alignment_property`](#function-vertical_content_alignment_property)
- [`text_property`](#function-text_property)
- [`selection_box_item_template_property`](#function-selection_box_item_template_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`drop_down_closed`](#function-drop_down_closed)
- [`drop_down_opened`](#function-drop_down_opened)
- [`is_drop_down_open`](#function-is_drop_down_open)
- [`set_is_drop_down_open`](#function-set_is_drop_down_open)
- [`is_editable`](#function-is_editable)
- [`set_is_editable`](#function-set_is_editable)
- [`max_drop_down_height`](#function-max_drop_down_height)
- [`set_max_drop_down_height`](#function-set_max_drop_down_height)
- [`selection_box_item`](#function-selection_box_item)
- [`set_selection_box_item`](#function-set_selection_box_item)
- [`placeholder_text`](#function-placeholder_text)
- [`set_placeholder_text`](#function-set_placeholder_text)
- [`placeholder_foreground`](#function-placeholder_foreground)
- [`set_placeholder_foreground`](#function-set_placeholder_foreground)
- [`horizontal_content_alignment`](#function-horizontal_content_alignment)
- [`set_horizontal_content_alignment`](#function-set_horizontal_content_alignment)
- [`vertical_content_alignment`](#function-vertical_content_alignment)
- [`set_vertical_content_alignment`](#function-set_vertical_content_alignment)
- [`selection_box_item_template`](#function-selection_box_item_template)
- [`set_selection_box_item_template`](#function-set_selection_box_item_template)
- [`text`](#function-text)
- [`set_text`](#function-set_text)
- [`clear`](#function-clear)

<a id="assoc_const-type"></a>

### TYPE

```rust
const TYPE: &'static $crate::TypeInfo
```

The runtime type of this class.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/combo_box.rs#L62)

<a id="function-to_ref"></a>

### to_ref

```rust
fn to_ref(self: &Self) -> $crate::Ref<ComboBox>
```

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/combo_box.rs#L62)

<a id="assoc_const-template_parts"></a>

### TEMPLATE_PARTS

```rust
const TEMPLATE_PARTS: &'static [TemplatePartAttribute]
```

The named parts expected in the control template.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/combo_box.rs#L328)

<a id="assoc_const-pseudo_classes"></a>

### PSEUDO_CLASSES

```rust
const PSEUDO_CLASSES: PseudoClassesAttribute
```

The pseudoclasses set by the class.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/combo_box.rs#L334)

<a id="function-is_drop_down_open_property"></a>

### is_drop_down_open_property

```rust
fn is_drop_down_open_property() -> &'static StyledProperty<bool>
```

Defines the `IsDropDownOpen` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/combo_box.rs#L338)

<a id="function-is_editable_property"></a>

### is_editable_property

```rust
fn is_editable_property() -> &'static StyledProperty<bool>
```

Defines the `IsEditable` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/combo_box.rs#L338)

<a id="function-max_drop_down_height_property"></a>

### max_drop_down_height_property

```rust
fn max_drop_down_height_property() -> &'static StyledProperty<f64>
```

Defines the `MaxDropDownHeight` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/combo_box.rs#L338)

<a id="function-selection_box_item_property"></a>

### selection_box_item_property

```rust
fn selection_box_item_property() -> &'static DirectProperty<ComboBox, Option<BoxedValue>>
```

Defines the `SelectionBoxItem` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/combo_box.rs#L338)

<a id="function-placeholder_text_property"></a>

### placeholder_text_property

```rust
fn placeholder_text_property() -> &'static StyledProperty<Option<String>>
```

Defines the `PlaceholderText` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/combo_box.rs#L338)

<a id="function-placeholder_foreground_property"></a>

### placeholder_foreground_property

```rust
fn placeholder_foreground_property() -> &'static StyledProperty<Option<Rc<dyn IBrush>>>
```

Defines the `PlaceholderForeground` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/combo_box.rs#L338)

<a id="function-horizontal_content_alignment_property"></a>

### horizontal_content_alignment_property

```rust
fn horizontal_content_alignment_property() -> &'static StyledProperty<HorizontalAlignment>
```

Defines the `HorizontalContentAlignment` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/combo_box.rs#L338)

<a id="function-vertical_content_alignment_property"></a>

### vertical_content_alignment_property

```rust
fn vertical_content_alignment_property() -> &'static StyledProperty<VerticalAlignment>
```

Defines the `VerticalContentAlignment` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/combo_box.rs#L338)

<a id="function-text_property"></a>

### text_property

```rust
fn text_property() -> &'static StyledProperty<Option<String>>
```

Defines the `Text` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/combo_box.rs#L338)

<a id="function-selection_box_item_template_property"></a>

### selection_box_item_template_property

```rust
fn selection_box_item_template_property() -> &'static StyledProperty<Option<Rc<dyn IDataTemplate>>>
```

Defines the `SelectionBoxItemTemplate` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/combo_box.rs#L338)

<a id="function-construct"></a>

### construct

```rust
fn construct() -> Self
```

Creates the class data; see `ferroui_base::FerroObject::construct`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/combo_box.rs#L445)

<a id="function-new"></a>

### new

```rust
fn new() -> Ref<Self>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/combo_box.rs#L460)

<a id="function-drop_down_closed"></a>

### drop_down_closed

```rust
fn drop_down_closed(self: &Self, handler: impl Fn() -> () + 'static) -> Subscription
```

Occurs after the drop-down (popup) list of the `ComboBox` closes.

Dropping the returned guard removes the handler; `Subscription::detach` keeps it for the
life of the combo box.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/combo_box.rs#L468)

<a id="function-drop_down_opened"></a>

### drop_down_opened

```rust
fn drop_down_opened(self: &Self, handler: impl Fn() -> () + 'static) -> Subscription
```

Occurs after the drop-down (popup) list of the `ComboBox` opens.

Dropping the returned guard removes the handler; `Subscription::detach` keeps it for the
life of the combo box.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/combo_box.rs#L482)

<a id="function-is_drop_down_open"></a>

### is_drop_down_open

```rust
fn is_drop_down_open(self: &Self) -> bool
```

Gets or sets a value indicating whether the dropdown is currently
open.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/combo_box.rs#L494)

<a id="function-set_is_drop_down_open"></a>

### set_is_drop_down_open

```rust
fn set_is_drop_down_open(self: &Self, value: bool)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/combo_box.rs#L498)

<a id="function-is_editable"></a>

### is_editable

```rust
fn is_editable(self: &Self) -> bool
```

Gets or sets a value indicating whether the control is editable.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/combo_box.rs#L503)

<a id="function-set_is_editable"></a>

### set_is_editable

```rust
fn set_is_editable(self: &Self, value: bool)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/combo_box.rs#L507)

<a id="function-max_drop_down_height"></a>

### max_drop_down_height

```rust
fn max_drop_down_height(self: &Self) -> f64
```

Gets or sets the maximum height for the dropdown list.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/combo_box.rs#L512)

<a id="function-set_max_drop_down_height"></a>

### set_max_drop_down_height

```rust
fn set_max_drop_down_height(self: &Self, value: f64)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/combo_box.rs#L516)

<a id="function-selection_box_item"></a>

### selection_box_item

```rust
fn selection_box_item(self: &Self) -> Option<BoxedValue>
```

Gets the item to display as the control's content.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/combo_box.rs#L521)

<a id="function-set_selection_box_item"></a>

### set_selection_box_item

```rust
fn set_selection_box_item(self: &Self, value: Option<BoxedValue>)
```

Sets the item to display as the control's content.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/combo_box.rs#L526)

<a id="function-placeholder_text"></a>

### placeholder_text

```rust
fn placeholder_text(self: &Self) -> Option<String>
```

Gets or sets the placeholder text.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/combo_box.rs#L531)

<a id="function-set_placeholder_text"></a>

### set_placeholder_text

```rust
fn set_placeholder_text(self: &Self, value: Option<String>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/combo_box.rs#L535)

<a id="function-placeholder_foreground"></a>

### placeholder_foreground

```rust
fn placeholder_foreground(self: &Self) -> Option<Rc<dyn IBrush>>
```

Gets or sets the brush that renders the placeholder text.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/combo_box.rs#L540)

<a id="function-set_placeholder_foreground"></a>

### set_placeholder_foreground

```rust
fn set_placeholder_foreground(self: &Self, value: Option<Rc<dyn IBrush>>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/combo_box.rs#L544)

<a id="function-horizontal_content_alignment"></a>

### horizontal_content_alignment

```rust
fn horizontal_content_alignment(self: &Self) -> HorizontalAlignment
```

Gets or sets the horizontal alignment of the content within the
control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/combo_box.rs#L550)

<a id="function-set_horizontal_content_alignment"></a>

### set_horizontal_content_alignment

```rust
fn set_horizontal_content_alignment(self: &Self, value: HorizontalAlignment)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/combo_box.rs#L554)

<a id="function-vertical_content_alignment"></a>

### vertical_content_alignment

```rust
fn vertical_content_alignment(self: &Self) -> VerticalAlignment
```

Gets or sets the vertical alignment of the content within the
control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/combo_box.rs#L560)

<a id="function-set_vertical_content_alignment"></a>

### set_vertical_content_alignment

```rust
fn set_vertical_content_alignment(self: &Self, value: VerticalAlignment)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/combo_box.rs#L564)

<a id="function-selection_box_item_template"></a>

### selection_box_item_template

```rust
fn selection_box_item_template(self: &Self) -> Option<Rc<dyn IDataTemplate>>
```

Gets or sets the data template used to display the selected item.
This has a higher priority than the item template if set.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/combo_box.rs#L570)

<a id="function-set_selection_box_item_template"></a>

### set_selection_box_item_template

```rust
fn set_selection_box_item_template(self: &Self, value: Option<Rc<dyn IDataTemplate>>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/combo_box.rs#L574)

<a id="function-text"></a>

### text

```rust
fn text(self: &Self) -> Option<String>
```

Gets or sets the text used when the control is editable. Does
nothing if it is not editable.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/combo_box.rs#L580)

<a id="function-set_text"></a>

### set_text

```rust
fn set_text(self: &Self, value: Option<String>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/combo_box.rs#L584)

<a id="function-clear"></a>

### clear

```rust
fn clear(self: &Self)
```

Clears the selection.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/combo_box.rs#L781)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`TemplatedControlImplExt`](/docs/0.5.0/api/ferroui-controls/primitives/trait-templatedcontrolimplext/)
- [`SelectingItemsControlImplExt`](/docs/0.5.0/api/ferroui-controls/primitives/trait-selectingitemscontrolimplext/)
- [`ControlImplExt`](/docs/0.5.0/api/ferroui-controls/trait-controlimplext/)
- [`ItemsControlImplExt`](/docs/0.5.0/api/ferroui-controls/trait-itemscontrolimplext/)
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- [`InputElementImplExt`](/docs/0.5.0/api/ferroui-base/input/trait-inputelementimplext/)
- [`InteractiveImplExt`](/docs/0.5.0/api/ferroui-base/interactivity/trait-interactiveimplext/)
- [`LayoutableImplExt`](/docs/0.5.0/api/ferroui-base/layout/trait-layoutableimplext/)
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`StyledElementImplExt`](/docs/0.5.0/api/ferroui-base/trait-styledelementimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- [`VisualImplExt`](/docs/0.5.0/api/ferroui-base/trait-visualimplext/)
- `ErasedDestructor`
- `IntoEither`
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<ComboBox>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`StaticType`](/docs/0.5.0/api/ferroui-base/trait-statictype/)
- [`ObjectType`](/docs/0.5.0/api/ferroui-base/trait-objecttype/)
- [`Subclassable<T>`](/docs/0.5.0/api/ferroui-base/trait-subclassable/)
- [`DefaultConstructible`](/docs/0.5.0/api/ferroui-base/trait-defaultconstructible/)
- [`StyledElementImpl`](/docs/0.5.0/api/ferroui-base/trait-styledelementimpl/)
- [`LayoutableImpl`](/docs/0.5.0/api/ferroui-base/layout/trait-layoutableimpl/)
- [`InteractiveImpl`](/docs/0.5.0/api/ferroui-base/interactivity/trait-interactiveimpl/)
- [`ControlImpl`](/docs/0.5.0/api/ferroui-controls/trait-controlimpl/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`VisualImpl`](/docs/0.5.0/api/ferroui-base/trait-visualimpl/)
- [`InputElementImpl`](/docs/0.5.0/api/ferroui-base/input/trait-inputelementimpl/)
- [`TemplatedControlImpl`](/docs/0.5.0/api/ferroui-controls/primitives/trait-templatedcontrolimpl/)
- [`ItemsControlImpl`](/docs/0.5.0/api/ferroui-controls/trait-itemscontrolimpl/)
- [`SelectingItemsControlImpl`](/docs/0.5.0/api/ferroui-controls/primitives/trait-selectingitemscontrolimpl/)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
