# Sandbox.UI.TextEntry

A [Sandbox.UI.Panel](/api/Sandbox.UI.Panel) that the user can enter text into.

- Kind: class
- Namespace: `Sandbox.UI`
- Assembly: `Sandbox.Engine`
- Inherits: [Sandbox.UI.BaseControl](/api/Sandbox.UI.BaseControl)

## Constructors

- [`TextEntry`](/api/Sandbox.UI.TextEntry/.ctor)

## Properties

- [`AcceptsImeInput`](/api/Sandbox.UI.TextEntry/AcceptsImeInput): Allow IME input when this is focused.
- [`AllowEmojiReplace`](/api/Sandbox.UI.TextEntry/AllowEmojiReplace): Whether to allow automatic replacement of emoji codes with their actual unicode emoji characters. See [Sandbox.UI.Emoji](/api/Sandbox.UI.Emoji).
- [`AutoComplete`](/api/Sandbox.UI.TextEntry/AutoComplete): If you hook a method up here we'll do autocomplete on it. Return a list if strings for given string input.
- [`CanRedo`](/api/Sandbox.UI.TextEntry/CanRedo): Is there anything to redo?
- [`CanUndo`](/api/Sandbox.UI.TextEntry/CanUndo): Is there anything to undo?
- [`CaretPosition`](/api/Sandbox.UI.TextEntry/CaretPosition)
- [`CharacterRegex`](/api/Sandbox.UI.TextEntry/CharacterRegex): If set, will block the input of any character that doesn't match. Will also set [Sandbox.UI.TextEntry.HasValidationErrors](/api/Sandbox.UI.TextEntry/HasValidationErrors) accordingly.
- [`Disabled`](/api/Sandbox.UI.TextEntry/Disabled): Is the text entry disabled? If disabled, will add a "disabled" class and prevent focus.
- [`HasClearButton`](/api/Sandbox.UI.TextEntry/HasClearButton): If true then Icon/IconPanel will be set to a clear button that clears the text when clicked.
- [`HasValidationErrors`](/api/Sandbox.UI.TextEntry/HasValidationErrors): If true then this control has validation errors and the input shouldn't be accepted.
- [`HistoryCookie`](/api/Sandbox.UI.TextEntry/HistoryCookie): If set, the history of this text entry will be stored and restored using this key in the local [Sandbox.Internal.GlobalGameNamespace.Cookie](/api/Sandbox.Internal.GlobalGameNamespace/Cookie).
- [`HistoryMaxItems`](/api/Sandbox.UI.TextEntry/HistoryMaxItems): Maximum amount of items [Sandbox.UI.TextEntry.AddToHistory](/api/Sandbox.UI.TextEntry/AddToHistory) will keep. Oldest items will be discarded as new ones are added.
- [`Icon`](/api/Sandbox.UI.TextEntry/Icon): If set, will display a material icon at the end of the text entry.
- [`IconPanel`](/api/Sandbox.UI.TextEntry/IconPanel): The [Sandbox.UI.IconPanel](/api/Sandbox.UI.IconPanel) that displays [Sandbox.UI.TextEntry.Icon](/api/Sandbox.UI.TextEntry/Icon)
- [`MaxLength`](/api/Sandbox.UI.TextEntry/MaxLength): If set, visually signals when the input text is longer than this value. Will also set [Sandbox.UI.TextEntry.HasValidationErrors](/api/Sandbox.UI.TextEntry/HasValidationErrors) accordingly.
- [`MaxValue`](/api/Sandbox.UI.TextEntry/MaxValue): If we're numeric, this is the highest numeric value allowed
- [`MinLength`](/api/Sandbox.UI.TextEntry/MinLength): If set, visually signals when the input text is shorter than this value. Will also set [Sandbox.UI.TextEntry.HasValidationErrors](/api/Sandbox.UI.TextEntry/HasValidationErrors) accordingly.
- [`MinValue`](/api/Sandbox.UI.TextEntry/MinValue): If we're numeric, this is the lowest numeric value allowed
- [`Multiline`](/api/Sandbox.UI.TextEntry/Multiline): Makes it possible to enter new lines into the text entry. (By pressing the Enter key, which no longer acts as the submit key)
- [`NumberFormat`](/api/Sandbox.UI.TextEntry/NumberFormat): Affects formatting of the text when [Sandbox.UI.TextEntry.Numeric](/api/Sandbox.UI.TextEntry/Numeric) is enabled. Accepts any format that is supported by `M:System.Single.ToString(System.String)`. See examples here.
- [`Numeric`](/api/Sandbox.UI.TextEntry/Numeric): When set to true, ensures only numeric values can be typed. Also applies [Sandbox.UI.TextEntry.FixNumeric](/api/Sandbox.UI.TextEntry/FixNumeric) on text.
- [`OnTextEdited`](/api/Sandbox.UI.TextEntry/OnTextEdited): Called when the text of this text entry is changed.
- [`Placeholder`](/api/Sandbox.UI.TextEntry/Placeholder): Text to display when the text entry is empty. Typically a very short description of the expected contents or function of the text entry.
- [`Prefix`](/api/Sandbox.UI.TextEntry/Prefix): If set, will display given text before the text entry box.
- [`PrefixLabel`](/api/Sandbox.UI.TextEntry/PrefixLabel): The [Sandbox.UI.TextEntry.Label](/api/Sandbox.UI.TextEntry/Label) that shows [Sandbox.UI.TextEntry.Prefix](/api/Sandbox.UI.TextEntry/Prefix) text.
- [`ReadOnly`](/api/Sandbox.UI.TextEntry/ReadOnly): The text can be selected and copied, but not changed. Unlike [Sandbox.UI.TextEntry.Disabled](/api/Sandbox.UI.TextEntry/Disabled) this still takes focus, so it reads and behaves like text rather than like a dead control.
- [`SelectionColor`](/api/Sandbox.UI.TextEntry/SelectionColor): The color used for text selection highlight. Defaults to cyan with transparency.
- [`StringRegex`](/api/Sandbox.UI.TextEntry/StringRegex): If set, [Sandbox.UI.TextEntry.HasValidationErrors](/api/Sandbox.UI.TextEntry/HasValidationErrors) will return true if doesn't match regex.
- [`Suffix`](/api/Sandbox.UI.TextEntry/Suffix): If set, will display given text after the text entry box.
- [`SuffixLabel`](/api/Sandbox.UI.TextEntry/SuffixLabel): The [Sandbox.UI.TextEntry.Label](/api/Sandbox.UI.TextEntry/Label) that shows [Sandbox.UI.TextEntry.Suffix](/api/Sandbox.UI.TextEntry/Suffix) text.
- [`SupportsMultiEdit`](/api/Sandbox.UI.TextEntry/SupportsMultiEdit)
- [`Text`](/api/Sandbox.UI.TextEntry/Text): Access to the raw text in the text entry.
- [`TextLength`](/api/Sandbox.UI.TextEntry/TextLength)
- [`Value`](/api/Sandbox.UI.TextEntry/Value): The value of the text entry. Returns [Sandbox.UI.TextEntry.Text](/api/Sandbox.UI.TextEntry/Text), but does special logic when setting text.
- [`WholeNumbers`](/api/Sandbox.UI.TextEntry/WholeNumbers): With [Sandbox.UI.TextEntry.Numeric](/api/Sandbox.UI.TextEntry/Numeric), only allow whole numbers - no decimal point.

## Methods

- [`AddToHistory`](/api/Sandbox.UI.TextEntry/AddToHistory): Add given string to the history of this text entry. The history can be accessed by the player by pressing up and down arrows with an empty text entry.
- [`CanEnterCharacter`](/api/Sandbox.UI.TextEntry/CanEnterCharacter): Called when a character is typed by the player.
- [`ClearHistory`](/api/Sandbox.UI.TextEntry/ClearHistory): Clear the input history that was previously added via [Sandbox.UI.TextEntry.AddToHistory](/api/Sandbox.UI.TextEntry/AddToHistory).
- [`ClearUndoHistory`](/api/Sandbox.UI.TextEntry/ClearUndoHistory): Throw the history away - for when the text is replaced by something the user didn't do.
- [`DestroyAutoComplete`](/api/Sandbox.UI.TextEntry/DestroyAutoComplete): Close and delete the auto complete popup panel.
- [`FixNumeric`](/api/Sandbox.UI.TextEntry/FixNumeric): Called to ensure the [Sandbox.UI.TextEntry.Text](/api/Sandbox.UI.TextEntry/Text) is absolutely in the correct format, in this case - a valid number format.
- [`GetClipboardValue`](/api/Sandbox.UI.TextEntry/GetClipboardValue)
- [`OnButtonEvent`](/api/Sandbox.UI.TextEntry/OnButtonEvent)
- [`OnButtonTyped`](/api/Sandbox.UI.TextEntry/OnButtonTyped)
- [`OnDraw`](/api/Sandbox.UI.TextEntry/OnDraw)
- [`OnKeyTyped`](/api/Sandbox.UI.TextEntry/OnKeyTyped)
- [`OnPaste`](/api/Sandbox.UI.TextEntry/OnPaste)
- [`OnValueChanged`](/api/Sandbox.UI.TextEntry/OnValueChanged): Called when the text entry's value changes.
- [`Redo`](/api/Sandbox.UI.TextEntry/Redo): Put back whatever the last undo took away.
- [`SetProperty`](/api/Sandbox.UI.TextEntry/SetProperty)
- [`Tick`](/api/Sandbox.UI.TextEntry/Tick)
- [`Undo`](/api/Sandbox.UI.TextEntry/Undo): Put back the text, caret and selection from before the last edit.
- [`UpdateAutoComplete`](/api/Sandbox.UI.TextEntry/UpdateAutoComplete): Open the auto complete popup with values from [Sandbox.UI.TextEntry.AutoComplete](/api/Sandbox.UI.TextEntry/AutoComplete). Close the popup if we have no auto complete entries.
- [`UpdateValidation`](/api/Sandbox.UI.TextEntry/UpdateValidation): Update the validation state of this control.
