# MaskedTextBox

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

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

```rust
struct MaskedTextBox
```

A text box that restricts its input with a mask.

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

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`ascii_only_property`](#function-ascii_only_property)
- [`culture_property`](#function-culture_property)
- [`hide_prompt_on_leave_property`](#function-hide_prompt_on_leave_property)
- [`mask_completed_property`](#function-mask_completed_property)
- [`mask_full_property`](#function-mask_full_property)
- [`mask_property`](#function-mask_property)
- [`prompt_char_property`](#function-prompt_char_property)
- [`reset_on_prompt_property`](#function-reset_on_prompt_property)
- [`reset_on_space_property`](#function-reset_on_space_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`with_provider`](#function-with_provider)
- [`ascii_only`](#function-ascii_only)
- [`set_ascii_only`](#function-set_ascii_only)
- [`culture`](#function-culture)
- [`set_culture`](#function-set_culture)
- [`hide_prompt_on_leave`](#function-hide_prompt_on_leave)
- [`set_hide_prompt_on_leave`](#function-set_hide_prompt_on_leave)
- [`mask`](#function-mask)
- [`set_mask`](#function-set_mask)
- [`mask_completed`](#function-mask_completed)
- [`mask_full`](#function-mask_full)
- [`mask_provider`](#function-mask_provider)
- [`prompt_char`](#function-prompt_char)
- [`set_prompt_char`](#function-set_prompt_char)
- [`reset_on_prompt`](#function-reset_on_prompt)
- [`set_reset_on_prompt`](#function-set_reset_on_prompt)
- [`reset_on_space`](#function-reset_on_space)
- [`set_reset_on_space`](#function-set_reset_on_space)

<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/masked_text_box.rs#L27)

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

### to_ref

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

Returns a strong reference to this object.

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

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

### ascii_only_property

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

Defines the `AsciiOnly` property.

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

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

### culture_property

```rust
fn culture_property() -> &'static StyledProperty<Option<CultureInfo>>
```

Defines the `Culture` property.

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

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

### hide_prompt_on_leave_property

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

Defines the `HidePromptOnLeave` property.

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

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

### mask_completed_property

```rust
fn mask_completed_property() -> &'static DirectProperty<MaskedTextBox, Option<bool>>
```

Defines the `MaskCompleted` property.

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

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

### mask_full_property

```rust
fn mask_full_property() -> &'static DirectProperty<MaskedTextBox, Option<bool>>
```

Defines the `MaskFull` property.

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

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

### mask_property

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

Defines the `Mask` property.

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

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

### prompt_char_property

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

Defines the `PromptChar` property.

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

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

### reset_on_prompt_property

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

Defines the `ResetOnPrompt` property.

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

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

### reset_on_space_property

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

Defines the `ResetOnSpace` property.

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

<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/masked_text_box.rs#L445)

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

### new

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

Initializes a new instance of the `MaskedTextBox` class.

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

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

### with_provider

```rust
fn with_provider(masked_text_provider: &MaskedTextProvider) -> Ref<Self>
```

Constructs the masked text box with the settings of the specified
provider.

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

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

### ascii_only

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

Whether the masked text box is restricted to accept only ASCII
characters. Default value is false.

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

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

### set_ascii_only

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



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

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

### culture

```rust
fn culture(self: &Self) -> Option<CultureInfo>
```

The culture information associated with the masked text box.

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

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

### set_culture

```rust
fn set_culture(self: &Self, value: Option<CultureInfo>)
```



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

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

### hide_prompt_on_leave

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

Whether the prompt character is hidden when the masked text box loses
focus.

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

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

### set_hide_prompt_on_leave

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



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

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

### mask

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

The mask to apply to the text box.

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

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

### set_mask

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



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

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

### mask_completed

```rust
fn mask_completed(self: &Self) -> Option<bool>
```

Specifies whether the test string required input positions, as
specified by the mask, have all been assigned.

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

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

### mask_full

```rust
fn mask_full(self: &Self) -> Option<bool>
```

Specifies whether all inputs (required and optional) have been
provided into the mask successfully.

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

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

### mask_provider

```rust
fn mask_provider(self: &Self) -> Option<Rc<RefCell<MaskedTextProvider>>>
```

The mask provider for the specified mask.

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

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

### prompt_char

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

The character used to represent the absence of user input in the
masked text box.

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

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

### set_prompt_char

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



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

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

### reset_on_prompt

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

Whether selected characters should be reset when the prompt character
is pressed.

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

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

### set_reset_on_prompt

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



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

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

### reset_on_space

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

Whether selected characters should be reset when the space character
is pressed.

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

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

### set_reset_on_space

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



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

## 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<MaskedTextBox>`](/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/)
- [`VisualImpl`](/docs/0.5.0/api/ferroui-base/trait-visualimpl/)
- [`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/)
- [`TemplatedControlImpl`](/docs/0.5.0/api/ferroui-controls/primitives/trait-templatedcontrolimpl/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`StyledElementImpl`](/docs/0.5.0/api/ferroui-base/trait-styledelementimpl/)
- [`InputElementImpl`](/docs/0.5.0/api/ferroui-base/input/trait-inputelementimpl/)
- [`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/).
