# TextBox

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

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

```rust
struct TextBox
```

Represents a control that can be used to display or edit unformatted
text.

Template parts: `PART_TextPresenter` (a [`TextPresenter`](/docs/0.5.0/api/ferroui-controls/presenters/struct-textpresenter/), required) and
`PART_ScrollViewer` (a [`ScrollViewer`](/docs/0.5.0/api/ferroui-controls/struct-scrollviewer/)). Pseudo-classes: `:empty`,
`:touch-mode`.

Every text position (`CaretIndex`, `SelectionStart`, `SelectionEnd`,
`MaxLength`) is a UTF-16 code unit index.

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

## Members

- [`text_undo_state`](#function-text_undo_state)
- [`set_text_undo_state`](#function-set_text_undo_state)
- [`is_restoring_text_history`](#function-is_restoring_text_history)
- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`coerce_text`](#function-coerce_text)
- [`cut_gesture`](#function-cut_gesture)
- [`copy_gesture`](#function-copy_gesture)
- [`paste_gesture`](#function-paste_gesture)
- [`is_inactive_selection_highlight_enabled_property`](#function-is_inactive_selection_highlight_enabled_property)
- [`clear_selection_on_lost_focus_property`](#function-clear_selection_on_lost_focus_property)
- [`accepts_return_property`](#function-accepts_return_property)
- [`accepts_tab_property`](#function-accepts_tab_property)
- [`caret_index_property`](#function-caret_index_property)
- [`is_read_only_property`](#function-is_read_only_property)
- [`password_char_property`](#function-password_char_property)
- [`selection_brush_property`](#function-selection_brush_property)
- [`selection_foreground_brush_property`](#function-selection_foreground_brush_property)
- [`caret_brush_property`](#function-caret_brush_property)
- [`caret_blink_interval_property`](#function-caret_blink_interval_property)
- [`selection_start_property`](#function-selection_start_property)
- [`selection_end_property`](#function-selection_end_property)
- [`max_length_property`](#function-max_length_property)
- [`max_lines_property`](#function-max_lines_property)
- [`min_lines_property`](#function-min_lines_property)
- [`text_property`](#function-text_property)
- [`text_style_overrides_property`](#function-text_style_overrides_property)
- [`text_paragraph_styles_property`](#function-text_paragraph_styles_property)
- [`text_alignment_property`](#function-text_alignment_property)
- [`horizontal_content_alignment_property`](#function-horizontal_content_alignment_property)
- [`vertical_content_alignment_property`](#function-vertical_content_alignment_property)
- [`text_wrapping_property`](#function-text_wrapping_property)
- [`line_height_property`](#function-line_height_property)
- [`placeholder_text_property`](#function-placeholder_text_property)
- [`watermark_property`](#function-watermark_property)
- [`use_floating_placeholder_property`](#function-use_floating_placeholder_property)
- [`use_floating_watermark_property`](#function-use_floating_watermark_property)
- [`placeholder_foreground_property`](#function-placeholder_foreground_property)
- [`watermark_foreground_property`](#function-watermark_foreground_property)
- [`new_line_property`](#function-new_line_property)
- [`inner_left_content_property`](#function-inner_left_content_property)
- [`inner_right_content_property`](#function-inner_right_content_property)
- [`reveal_password_property`](#function-reveal_password_property)
- [`can_cut_property`](#function-can_cut_property)
- [`can_copy_property`](#function-can_copy_property)
- [`can_paste_property`](#function-can_paste_property)
- [`is_undo_enabled_property`](#function-is_undo_enabled_property)
- [`undo_limit_property`](#function-undo_limit_property)
- [`can_undo_property`](#function-can_undo_property)
- [`can_redo_property`](#function-can_redo_property)
- [`copying_to_clipboard_event`](#function-copying_to_clipboard_event)
- [`cutting_to_clipboard_event`](#function-cutting_to_clipboard_event)
- [`pasting_from_clipboard_event`](#function-pasting_from_clipboard_event)
- [`text_changed_event`](#function-text_changed_event)
- [`text_changing_event`](#function-text_changing_event)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`is_inactive_selection_highlight_enabled`](#function-is_inactive_selection_highlight_enabled)
- [`set_is_inactive_selection_highlight_enabled`](#function-set_is_inactive_selection_highlight_enabled)
- [`clear_selection_on_lost_focus`](#function-clear_selection_on_lost_focus)
- [`set_clear_selection_on_lost_focus`](#function-set_clear_selection_on_lost_focus)
- [`accepts_return`](#function-accepts_return)
- [`set_accepts_return`](#function-set_accepts_return)
- [`accepts_tab`](#function-accepts_tab)
- [`set_accepts_tab`](#function-set_accepts_tab)
- [`caret_index`](#function-caret_index)
- [`set_caret_index`](#function-set_caret_index)
- [`is_read_only`](#function-is_read_only)
- [`set_is_read_only`](#function-set_is_read_only)
- [`password_char`](#function-password_char)
- [`set_password_char`](#function-set_password_char)
- [`selection_brush`](#function-selection_brush)
- [`set_selection_brush`](#function-set_selection_brush)
- [`selection_foreground_brush`](#function-selection_foreground_brush)
- [`set_selection_foreground_brush`](#function-set_selection_foreground_brush)
- [`caret_brush`](#function-caret_brush)
- [`set_caret_brush`](#function-set_caret_brush)
- [`caret_blink_interval`](#function-caret_blink_interval)
- [`set_caret_blink_interval`](#function-set_caret_blink_interval)
- [`selection_start`](#function-selection_start)
- [`set_selection_start`](#function-set_selection_start)
- [`selection_changed`](#function-selection_changed)
- [`set_selection_and_caret`](#function-set_selection_and_caret)
- [`selection_end`](#function-selection_end)
- [`set_selection_end`](#function-set_selection_end)
- [`max_length`](#function-max_length)
- [`set_max_length`](#function-set_max_length)
- [`max_lines`](#function-max_lines)
- [`set_max_lines`](#function-set_max_lines)
- [`min_lines`](#function-min_lines)
- [`set_min_lines`](#function-set_min_lines)
- [`line_height`](#function-line_height)
- [`set_line_height`](#function-set_line_height)
- [`text`](#function-text)
- [`set_text`](#function-set_text)
- [`is_composing_text`](#function-is_composing_text)
- [`selected_text`](#function-selected_text)
- [`set_selected_text`](#function-set_selected_text)
- [`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)
- [`text_style_overrides`](#function-text_style_overrides)
- [`set_text_style_overrides`](#function-set_text_style_overrides)
- [`text_paragraph_styles`](#function-text_paragraph_styles)
- [`set_text_paragraph_styles`](#function-set_text_paragraph_styles)
- [`text_alignment`](#function-text_alignment)
- [`set_text_alignment`](#function-set_text_alignment)
- [`placeholder_text`](#function-placeholder_text)
- [`set_placeholder_text`](#function-set_placeholder_text)
- [`watermark`](#function-watermark)
- [`set_watermark`](#function-set_watermark)
- [`use_floating_placeholder`](#function-use_floating_placeholder)
- [`set_use_floating_placeholder`](#function-set_use_floating_placeholder)
- [`use_floating_watermark`](#function-use_floating_watermark)
- [`set_use_floating_watermark`](#function-set_use_floating_watermark)
- [`placeholder_foreground`](#function-placeholder_foreground)
- [`set_placeholder_foreground`](#function-set_placeholder_foreground)
- [`watermark_foreground`](#function-watermark_foreground)
- [`set_watermark_foreground`](#function-set_watermark_foreground)
- [`inner_left_content`](#function-inner_left_content)
- [`set_inner_left_content`](#function-set_inner_left_content)
- [`inner_right_content`](#function-inner_right_content)
- [`set_inner_right_content`](#function-set_inner_right_content)
- [`reveal_password`](#function-reveal_password)
- [`set_reveal_password`](#function-set_reveal_password)
- [`text_wrapping`](#function-text_wrapping)
- [`set_text_wrapping`](#function-set_text_wrapping)
- [`new_line`](#function-new_line)
- [`set_new_line`](#function-set_new_line)
- [`clear_selection`](#function-clear_selection)
- [`can_cut`](#function-can_cut)
- [`can_copy`](#function-can_copy)
- [`can_paste`](#function-can_paste)
- [`is_undo_enabled`](#function-is_undo_enabled)
- [`set_is_undo_enabled`](#function-set_is_undo_enabled)
- [`undo_limit`](#function-undo_limit)
- [`set_undo_limit`](#function-set_undo_limit)
- [`can_undo`](#function-can_undo)
- [`can_redo`](#function-can_redo)
- [`get_line_count`](#function-get_line_count)
- [`copying_to_clipboard`](#function-copying_to_clipboard)
- [`cutting_to_clipboard`](#function-cutting_to_clipboard)
- [`pasting_from_clipboard`](#function-pasting_from_clipboard)
- [`text_changed`](#function-text_changed)
- [`text_changing`](#function-text_changing)
- [`cut`](#function-cut)
- [`copy`](#function-copy)
- [`paste`](#function-paste)
- [`clear`](#function-clear)
- [`scroll_to_line`](#function-scroll_to_line)
- [`select_all`](#function-select_all)
- [`undo`](#function-undo)
- [`redo`](#function-redo)

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

### text_undo_state

```rust
fn text_undo_state(self: &Self) -> Option<Rc<dyn Any>>
```

The application's immutable rich-text snapshot for the current text.

Native undo and redo restore this value, together with character and
paragraph styles, before the synchronous `TextChanging` notification.
An editor can downcast it and restore its document ranges exactly rather
than guessing the deleted styling from the old and new strings. The
application should verify that the snapshot describes the current Text.

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

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

### set_text_undo_state

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

Associate an immutable application snapshot with the current text.

Call this after updating rich styles in `TextChanging`, including after
an external Text replacement. If the native undo helper has already
captured this exact text, its current final snapshot is updated in place.
This neither adds an undo step nor discards redo. Snapshots share the
native undo limit and coalescing rules; callers must not mutate a payload
after passing it here.

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

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

### is_restoring_text_history

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

Whether native undo or redo is currently restoring a text snapshot.

This is intended for synchronous `TextChanging` handlers. The later,
asynchronous `TextChanged` notification runs after restoration has ended.

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

<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/text_box.rs#L121)

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

### to_ref

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

Returns a strong reference to this object.

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

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

### coerce_text

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

Coerces the current text.

This method also manages the internal undo/redo state whenever
the text changes: if overridden, ensure that the base is called
or undo/redo won't work correctly.

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

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

### cut_gesture

```rust
fn cut_gesture() -> Option<KeyGesture>
```

A platform-specific `KeyGesture` for the cut action.

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

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

### copy_gesture

```rust
fn copy_gesture() -> Option<KeyGesture>
```

A platform-specific `KeyGesture` for the copy action.

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

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

### paste_gesture

```rust
fn paste_gesture() -> Option<KeyGesture>
```

A platform-specific `KeyGesture` for the paste action.

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

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

### is_inactive_selection_highlight_enabled_property

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

Defines the `IsInactiveSelectionHighlightEnabled` property.

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

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

### clear_selection_on_lost_focus_property

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

Defines the `ClearSelectionOnLostFocus` property.

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

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

### accepts_return_property

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

Defines the `AcceptsReturn` property.

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

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

### accepts_tab_property

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

Defines the `AcceptsTab` property.

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

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

### caret_index_property

```rust
fn caret_index_property() -> &'static StyledProperty<i32>
```

Defines the `CaretIndex` property.

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

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

### is_read_only_property

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

Defines the `IsReadOnly` property.

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

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

### password_char_property

```rust
fn password_char_property() -> &'static StyledProperty<char>
```

Defines the `PasswordChar` property (`'\0'`: none).

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

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

### selection_brush_property

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

Defines the `SelectionBrush` property.

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

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

### selection_foreground_brush_property

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

Defines the `SelectionForegroundBrush` property.

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

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

### caret_brush_property

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

Defines the `CaretBrush` property.

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

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

### caret_blink_interval_property

```rust
fn caret_blink_interval_property() -> &'static StyledProperty<Duration>
```

Defines the `CaretBlinkInterval` property.

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

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

### selection_start_property

```rust
fn selection_start_property() -> &'static StyledProperty<i32>
```

Defines the `SelectionStart` property.

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

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

### selection_end_property

```rust
fn selection_end_property() -> &'static StyledProperty<i32>
```

Defines the `SelectionEnd` property.

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

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

### max_length_property

```rust
fn max_length_property() -> &'static StyledProperty<i32>
```

Defines the `MaxLength` property.

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

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

### max_lines_property

```rust
fn max_lines_property() -> &'static StyledProperty<i32>
```

Defines the `MaxLines` property.

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

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

### min_lines_property

```rust
fn min_lines_property() -> &'static StyledProperty<i32>
```

Defines the `MinLines` property.

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

<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/text_box.rs#L1194)

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

### text_style_overrides_property

```rust
fn text_style_overrides_property() -> &'static StyledProperty<Option<TextStyleOverrides>>
```

Defines the `TextStyleOverrides` property. Control templates bind
this to the presenter's property, just like `Text` and `TextWrapping`.

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

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

### text_paragraph_styles_property

```rust
fn text_paragraph_styles_property() -> &'static StyledProperty<Option<TextParagraphStyles>>
```

Defines immutable UTF-16 paragraph formatting. Templates bind this
to TextPresenter, keeping rendering, IME and caret geometry shared.

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

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

### text_alignment_property

```rust
fn text_alignment_property() -> &'static AttachedProperty<TextAlignment>
```

Defines the `TextAlignment` property.

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

<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/text_box.rs#L1194)

<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/text_box.rs#L1194)

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

### text_wrapping_property

```rust
fn text_wrapping_property() -> &'static AttachedProperty<TextWrapping>
```

Defines the `TextWrapping` property.

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

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

### line_height_property

```rust
fn line_height_property() -> &'static AttachedProperty<f64>
```

Defines the `LineHeight` property.

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

<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/text_box.rs#L1194)

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

### watermark_property

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

Defines the `Watermark` property.

> **Deprecated.** Use placeholder_text_property instead.

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

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

### use_floating_placeholder_property

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

Defines the `UseFloatingPlaceholder` property.

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

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

### use_floating_watermark_property

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

Defines the `UseFloatingWatermark` property.

> **Deprecated.** Use use_floating_placeholder_property instead.

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

<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/text_box.rs#L1421)

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

### watermark_foreground_property

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

Defines the `WatermarkForeground` property.

> **Deprecated.** Use placeholder_foreground_property instead.

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

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

### new_line_property

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

Defines the `NewLine` property.

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

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

### inner_left_content_property

```rust
fn inner_left_content_property() -> &'static StyledProperty<Option<BoxedValue>>
```

Defines the `InnerLeftContent` property.

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

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

### inner_right_content_property

```rust
fn inner_right_content_property() -> &'static StyledProperty<Option<BoxedValue>>
```

Defines the `InnerRightContent` property.

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

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

### reveal_password_property

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

Defines the `RevealPassword` property.

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

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

### can_cut_property

```rust
fn can_cut_property() -> &'static DirectProperty<TextBox, bool>
```

Defines the `CanCut` property.

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

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

### can_copy_property

```rust
fn can_copy_property() -> &'static DirectProperty<TextBox, bool>
```

Defines the `CanCopy` property.

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

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

### can_paste_property

```rust
fn can_paste_property() -> &'static DirectProperty<TextBox, bool>
```

Defines the `CanPaste` property.

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

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

### is_undo_enabled_property

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

Defines the `IsUndoEnabled` property.

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

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

### undo_limit_property

```rust
fn undo_limit_property() -> &'static StyledProperty<i32>
```

Defines the `UndoLimit` property.

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

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

### can_undo_property

```rust
fn can_undo_property() -> &'static DirectProperty<TextBox, bool>
```

Defines the `CanUndo` property.

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

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

### can_redo_property

```rust
fn can_redo_property() -> &'static DirectProperty<TextBox, bool>
```

Defines the `CanRedo` property.

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

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

### copying_to_clipboard_event

```rust
fn copying_to_clipboard_event() -> &'static RoutedEvent<RoutedEventArgs>
```

Defines the `CopyingToClipboard` event.

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

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

### cutting_to_clipboard_event

```rust
fn cutting_to_clipboard_event() -> &'static RoutedEvent<RoutedEventArgs>
```

Defines the `CuttingToClipboard` event.

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

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

### pasting_from_clipboard_event

```rust
fn pasting_from_clipboard_event() -> &'static RoutedEvent<RoutedEventArgs>
```

Defines the `PastingFromClipboard` event.

The event is raised with `PastingFromClipboardEventArgs`.

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

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

### text_changed_event

```rust
fn text_changed_event() -> &'static RoutedEvent<TextChangedEventArgs>
```

Defines the `TextChanged` event.

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

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

### text_changing_event

```rust
fn text_changing_event() -> &'static RoutedEvent<TextChangingEventArgs>
```

Defines the `TextChanging` event.

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

<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/text_box.rs#L1582)

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

### new

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

Initializes a new instance of the `TextBox` class.

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

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

### is_inactive_selection_highlight_enabled

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

Whether the text box shows a selection highlight when it is not
focused.

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

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

### set_is_inactive_selection_highlight_enabled

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



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

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

### clear_selection_on_lost_focus

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

Whether the text box clears its selection after it loses focus.

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

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

### set_clear_selection_on_lost_focus

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



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

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

### accepts_return

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

Whether the text box allows and displays newline or return
characters.

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

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

### set_accepts_return

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



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

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

### accepts_tab

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

Whether the text box allows and displays tabs.

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

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

### set_accepts_tab

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



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

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

### caret_index

```rust
fn caret_index(self: &Self) -> i32
```

The index of the text caret.

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

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

### set_caret_index

```rust
fn set_caret_index(self: &Self, value: i32)
```



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

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

### is_read_only

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

Whether this text box is read-only.

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

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

### set_is_read_only

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



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

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

### password_char

```rust
fn password_char(self: &Self) -> char
```

The character that should be used for password masking (`'\0'`:
none).

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

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

### set_password_char

```rust
fn set_password_char(self: &Self, value: char)
```



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

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

### selection_brush

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

A brush that is used to highlight selected text.

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

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

### set_selection_brush

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



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

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

### selection_foreground_brush

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

A brush that is used for the foreground of selected text.

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

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

### set_selection_foreground_brush

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



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

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

### caret_brush

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

A brush that is used for the text caret.

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

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

### set_caret_brush

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



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

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

### caret_blink_interval

```rust
fn caret_blink_interval(self: &Self) -> Duration
```

The caret blink rate.

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

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

### set_caret_blink_interval

```rust
fn set_caret_blink_interval(self: &Self, value: Duration)
```



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

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

### selection_start

```rust
fn selection_start(self: &Self) -> i32
```

The starting position of the text selected in the text box.

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

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

### set_selection_start

```rust
fn set_selection_start(self: &Self, value: i32)
```



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

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

### selection_changed

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

Observes completed selection operations, independently of focus, read-only
state or presenter creation. Individual endpoint writes remain individual
operations.

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

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

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

### set_selection_and_caret

```rust
fn set_selection_and_caret(self: &Self, selection: ferroui_base::input::text_input::TextSelection, caret_index: i32)
```

Sets the UTF-16 range and caret as one native selection operation. Property
notifications retain their usual order; selection observers see the final
coerced range when the operation completes.

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

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

### selection_end

```rust
fn selection_end(self: &Self) -> i32
```

The end position of the text selected in the text box.

When the `SelectionEnd` is equal to `SelectionStart`, there is no
selected text and it marks the caret position.

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

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

### set_selection_end

```rust
fn set_selection_end(self: &Self, value: i32)
```



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

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

### max_length

```rust
fn max_length(self: &Self) -> i32
```

The maximum number of characters that the text box can accept. This
constraint only applies for manually entered (user-inputted) text.

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

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

### set_max_length

```rust
fn set_max_length(self: &Self, value: i32)
```



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

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

### max_lines

```rust
fn max_lines(self: &Self) -> i32
```

The maximum number of visible lines to size to.

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

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

### set_max_lines

```rust
fn set_max_lines(self: &Self, value: i32)
```



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

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

### min_lines

```rust
fn min_lines(self: &Self) -> i32
```

The minimum number of visible lines to size to.

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

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

### set_min_lines

```rust
fn set_min_lines(self: &Self, value: i32)
```



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

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

### line_height

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

The line height.

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

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

### set_line_height

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



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

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

### text

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

The text content of the text box.

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

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

### set_text

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



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

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

### is_composing_text

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

Whether the input method has supplied pending preedit text.

An empty preedit update is still pending. The input method clears this
state explicitly with `None`, or it is cleared when the client detaches
from its presenter. Unlike the presenter's visual preedit, this state
survives selection and caret synchronization during `TextChanging`.

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

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

### selected_text

```rust
fn selected_text(self: &Self) -> String
```

The text selected in the text box.

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

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

### set_selected_text

```rust
fn set_selected_text(self: &Self, value: Option<&str>)
```

Replaces the selected text; a null or empty value deletes it.

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

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

### horizontal_content_alignment

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

The horizontal alignment of the content within the control.

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

<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/text_box.rs#L1896)

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

### vertical_content_alignment

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

The vertical alignment of the content within the control.

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

<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/text_box.rs#L1905)

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

### text_style_overrides

```rust
fn text_style_overrides(self: &Self) -> Option<TextStyleOverrides>
```

Complete run properties at UTF-16 ranges of `Text`. Applications that
own rich documents should update the immutable collection in
`TextChanging` after rebasing their committed ranges. IME preedit remains
a temporary presentation and does not alter the supplied collection.

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

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

### set_text_style_overrides

```rust
fn set_text_style_overrides(self: &Self, value: Option<TextStyleOverrides>)
```



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

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

### text_paragraph_styles

```rust
fn text_paragraph_styles(self: &Self) -> Option<TextParagraphStyles>
```

Whole-paragraph styles at UTF-16 positions. Rebase committed ranges in
TextChanging as with TextStyleOverrides; provisional IME text is remapped
automatically without mutating this collection.

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

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

### set_text_paragraph_styles

```rust
fn set_text_paragraph_styles(self: &Self, value: Option<TextParagraphStyles>)
```



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

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

### text_alignment

```rust
fn text_alignment(self: &Self) -> TextAlignment
```

The text alignment of the text box.

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

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

### set_text_alignment

```rust
fn set_text_alignment(self: &Self, value: TextAlignment)
```



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

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

### placeholder_text

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

The placeholder or descriptive text that is displayed even if the
`Text` property is not yet set.

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

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

### set_placeholder_text

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



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

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

### watermark

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

The placeholder or descriptive text that is displayed even if the
`Text` property is not yet set.

> **Deprecated.** Use placeholder_text instead.

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

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

### set_watermark

```rust
fn set_watermark(self: &Self, value: Option<&str>)
```



> **Deprecated.** Use set_placeholder_text instead.

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

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

### use_floating_placeholder

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

Whether the `PlaceholderText` will still be shown above the `Text`
even after a text value is set.

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

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

### set_use_floating_placeholder

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



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

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

### use_floating_watermark

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

Whether the `PlaceholderText` will still be shown above the `Text`
even after a text value is set.

> **Deprecated.** Use use_floating_placeholder instead.

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

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

### set_use_floating_watermark

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



> **Deprecated.** Use set_use_floating_placeholder instead.

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

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

### placeholder_foreground

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

The brush used for the foreground color of the placeholder text.

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

<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/text_box.rs#L1990)

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

### watermark_foreground

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

The brush used for the foreground color of the placeholder text.

> **Deprecated.** Use placeholder_foreground instead.

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

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

### set_watermark_foreground

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



> **Deprecated.** Use set_placeholder_foreground instead.

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

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

### inner_left_content

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

Custom content that is positioned on the left side of the text
layout box.

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

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

### set_inner_left_content

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



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

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

### inner_right_content

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

Custom content that is positioned on the right side of the text
layout box.

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

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

### set_inner_right_content

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



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

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

### reveal_password

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

Whether text masked by `PasswordChar` should be revealed.

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

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

### set_reveal_password

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



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

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

### text_wrapping

```rust
fn text_wrapping(self: &Self) -> TextWrapping
```

The text wrapping of the text box.

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

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

### set_text_wrapping

```rust
fn set_text_wrapping(self: &Self, value: TextWrapping)
```



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

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

### new_line

```rust
fn new_line(self: &Self) -> String
```

Which characters are inserted when Enter is pressed. Default: the
line break of the platform.

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

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

### set_new_line

```rust
fn set_new_line(self: &Self, value: &str)
```



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

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

### clear_selection

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

Clears the current selection, maintaining the `CaretIndex`.

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

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

### can_cut

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

Whether the cut command can be executed.

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

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

### can_copy

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

Whether the copy command can be executed.

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

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

### can_paste

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

Whether the paste command can be executed.

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

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

### is_undo_enabled

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

Whether undo/redo is enabled.

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

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

### set_is_undo_enabled

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



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

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

### undo_limit

```rust
fn undo_limit(self: &Self) -> i32
```

The maximum number of items that can reside in the undo stack.

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

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

### set_undo_limit

```rust
fn set_undo_limit(self: &Self, value: i32)
```



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

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

### can_undo

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

Whether the undo stack has an action that can be undone.

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

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

### can_redo

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

Whether the redo stack has an action that can be redone.

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

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

### get_line_count

```rust
fn get_line_count(self: &Self) -> i32
```

The number of lines in the text box, or -1 if no layout information
is available.

If the text wraps, changing the width of the text box may change this
value. The value returned is the number of lines in the entire text
box, regardless of how many are currently in view.

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

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

### copying_to_clipboard

```rust
fn copying_to_clipboard(self: &Self, handler: impl Fn(&Interactive, &RoutedEventArgs) -> () + 'static) -> RoutedEventHandlerToken
```

Raised when content is being copied to the clipboard.

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

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

### cutting_to_clipboard

```rust
fn cutting_to_clipboard(self: &Self, handler: impl Fn(&Interactive, &RoutedEventArgs) -> () + 'static) -> RoutedEventHandlerToken
```

Raised when content is being cut to the clipboard.

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

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

### pasting_from_clipboard

```rust
fn pasting_from_clipboard(self: &Self, handler: impl Fn(&Interactive, &dyn IRoutedEventArgs) -> () + 'static) -> RoutedEventHandlerToken
```

Raised when content is being pasted from the clipboard.

The event is raised with `PastingFromClipboardEventArgs`: the
handler receives the args as raised, so that it can reach them with
`e.downcast_ref::<PastingFromClipboardEventArgs>()` (the event itself
is declared with the base args, as in the reference).

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

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

### text_changed

```rust
fn text_changed(self: &Self, handler: impl Fn(&Interactive, &TextChangedEventArgs) -> () + 'static) -> RoutedEventHandlerToken
```

Occurs asynchronously after text changes and the new text is
rendered.

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

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

### text_changing

```rust
fn text_changing(self: &Self, handler: impl Fn(&Interactive, &TextChangingEventArgs) -> () + 'static) -> RoutedEventHandlerToken
```

Occurs synchronously when text starts to change but before it is
rendered.

This event occurs just after the `Text` property value has been
updated.

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

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

### cut

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

Cuts the current text onto the clipboard.

Like the asynchronous method of the reference, everything up to the
clipboard call runs before this returns; the selection is deleted
once the clipboard has taken the text, from a dispatcher job unless
the clipboard completed at once. A failure platform clipboards are
known for (see `ClipboardHelper::is_expected_clipboard_exception`)
is logged and leaves the selection in place; any other failure, and
a panic of the clipboard, is raised on the dispatcher.

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

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

### copy

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

Copies the current text onto the clipboard.

See `cut` for how the clipboard operation runs.

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

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

### paste

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

Pastes the current clipboard text content into the text box.

See `cut` for how the clipboard operation runs.

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

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

### clear

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

Clears the text in the text box.

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

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

### scroll_to_line

```rust
fn scroll_to_line(self: &Self, line_index: i32)
```

Scrolls the text box to the specified line index.
## Panics

When `line_index` is less than zero, or larger than or equal to the
line count.

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

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

### select_all

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

Selects all text in the text box.

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

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

### undo

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

Undoes the first action in the undo stack.

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

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

### redo

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

Reapplies the first item on the redo stack.

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`TemplatedControlImplExt`](/docs/0.5.0/api/ferroui-controls/primitives/trait-templatedcontrolimplext/)
- [`ControlImplExt`](/docs/0.5.0/api/ferroui-controls/trait-controlimplext/)
- [`TextBoxImplExt`](/docs/0.5.0/api/ferroui-controls/trait-textboximplext/)
- `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<TextBox>`](/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/)
- [`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/)
- [`InputElementImpl`](/docs/0.5.0/api/ferroui-base/input/trait-inputelementimpl/)
- [`TemplatedControlImpl`](/docs/0.5.0/api/ferroui-controls/primitives/trait-templatedcontrolimpl/)
- [`TextBoxImpl`](/docs/0.5.0/api/ferroui-controls/trait-textboximpl/)

## Availability

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