# TabControl

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

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

```rust
struct TabControl
```

A tab control that displays a tab strip along with the content of the
selected tab.

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

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`register_content_presenter`](#function-register_content_presenter)
- [`TEMPLATE_PARTS`](#assoc_const-template_parts)
- [`tab_strip_placement_property`](#function-tab_strip_placement_property)
- [`horizontal_content_alignment_property`](#function-horizontal_content_alignment_property)
- [`vertical_content_alignment_property`](#function-vertical_content_alignment_property)
- [`content_template_property`](#function-content_template_property)
- [`selected_content_property`](#function-selected_content_property)
- [`selected_content_template_property`](#function-selected_content_template_property)
- [`page_transition_property`](#function-page_transition_property)
- [`indicator_template_property`](#function-indicator_template_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`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)
- [`tab_strip_placement`](#function-tab_strip_placement)
- [`set_tab_strip_placement`](#function-set_tab_strip_placement)
- [`content_template`](#function-content_template)
- [`set_content_template`](#function-set_content_template)
- [`selected_content`](#function-selected_content)
- [`selected_content_template`](#function-selected_content_template)
- [`page_transition`](#function-page_transition)
- [`set_page_transition`](#function-set_page_transition)
- [`indicator_template`](#function-indicator_template)
- [`set_indicator_template`](#function-set_indicator_template)

<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/tab_control.rs#L55)

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

### to_ref

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

Returns a strong reference to this object.

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

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

### register_content_presenter

```rust
fn register_content_presenter(self: &Self, presenter: &ContentPresenter) -> bool
```

Called when a `ContentPresenter` is registered with the
control.

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

<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/tab_control.rs#L281)

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

### tab_strip_placement_property

```rust
fn tab_strip_placement_property() -> &'static StyledProperty<Dock>
```

Defines the `TabStripPlacement` property.

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

<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/tab_control.rs#L288)

<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/tab_control.rs#L288)

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

### content_template_property

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

Defines the `ContentTemplate` property.

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

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

### selected_content_property

```rust
fn selected_content_property() -> &'static DirectProperty<TabControl, Option<BoxedValue>>
```

Defines the `SelectedContent` property.

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

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

### selected_content_template_property

```rust
fn selected_content_template_property() -> &'static DirectProperty<TabControl, Option<Rc<dyn IDataTemplate>>>
```

Defines the `SelectedContentTemplate` property.

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

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

### page_transition_property

```rust
fn page_transition_property() -> &'static StyledProperty<Option<Rc<dyn IPageTransition>>>
```

Defines the `PageTransition` property.

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

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

### indicator_template_property

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

Defines the `IndicatorTemplate` property.

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

<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/tab_control.rs#L373)

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

### new

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



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

<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/tab_control.rs#L397)

<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/tab_control.rs#L401)

<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/tab_control.rs#L407)

<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/tab_control.rs#L411)

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

### tab_strip_placement

```rust
fn tab_strip_placement(self: &Self) -> Dock
```

Gets or sets the tabstrip placement of the `TabControl`.

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

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

### set_tab_strip_placement

```rust
fn set_tab_strip_placement(self: &Self, value: Dock)
```



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

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

### content_template

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

Gets or sets the default data template used to display the content
of the selected tab.

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

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

### set_content_template

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



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

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

### selected_content

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

Gets the content of the selected tab.

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

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

### selected_content_template

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

Gets the content template for the selected tab.

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

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

### page_transition

```rust
fn page_transition(self: &Self) -> Option<Rc<dyn IPageTransition>>
```

Gets or sets the page transition to use when switching tabs.

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

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

### set_page_transition

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



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

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

### indicator_template

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

Gets or sets the data template used to render the selection
indicator on each tab item.

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

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

### set_indicator_template

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



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

## 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/)
- [`TabControlImplExt`](/docs/0.5.0/api/ferroui-controls/trait-tabcontrolimplext/)
- `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<TabControl>`](/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/)
- [`InteractiveImpl`](/docs/0.5.0/api/ferroui-base/interactivity/trait-interactiveimpl/)
- [`InputElementImpl`](/docs/0.5.0/api/ferroui-base/input/trait-inputelementimpl/)
- [`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/)
- [`LayoutableImpl`](/docs/0.5.0/api/ferroui-base/layout/trait-layoutableimpl/)
- [`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/)
- [`TabControlImpl`](/docs/0.5.0/api/ferroui-controls/trait-tabcontrolimpl/)
- [`IContentPresenterHost`](/docs/0.5.0/api/ferroui-controls/presenters/trait-icontentpresenterhost/)

## Availability

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