# TextBoxBase

Namespace: **Wisej.Web**

Assembly: **Wisej.Framework** (4.0.0.0)

* [Control](/api/wisej.web/general/control.md)
  * [TextBoxBase](/api/wisej.web/editors/wisej.web.textboxbase.md)

Implements the basic functionality required by text controls.

{% tabs %}
{% tab title="C#" %}

```csharp
public class TextBoxBase : Control, IModified, ILabel, IReadOnly, IValidation
```

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Class TextBoxBase
    Inherits Control
    Implements IModified, ILabel, IReadOnly, IValidation
```

{% endtab %}
{% endtabs %}

## Constructors

### ![](/files/hsR4ok3152WyAf8J2C1u) TextBoxBase()

Initializes an instance of a TextBoxBase derived control.

## Properties

### ![](/files/hsR4ok3152WyAf8J2C1u) AcceptsTab

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether pressing the TAB key in a multiline text box control types a TAB character in the control instead of moving the focus to the next control in the tab order. (Default: `False`)

The [Multiline](#multiline) property must be true to get a TAB character in the control.

### ![](/files/hsR4ok3152WyAf8J2C1u) AutoComplete

[AutoComplete](/api/wisej.web/enumerations/wisej.web.autocomplete.md): Returns of sets whether the browser can auto complete the field with values previously entered by the user. (Default: `Default`)

### ![](/files/hsR4ok3152WyAf8J2C1u) AutoCompleteList

[String\[\]](https://docs.microsoft.com/dotnet/api/system.string): Identifies a list of pre-defined options to suggest to the user. (Default: `null`)

### ![](/files/hsR4ok3152WyAf8J2C1u) AutoSize

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether the height of the control is set automatically. (Default: `True`)

### ![](/files/hsR4ok3152WyAf8J2C1u) BorderStyle

[BorderStyle](/api/wisej.web/enumerations/wisej.web.borderstyle.md): Returns or sets the border type of the text box control. (Default: `Solid`)

### ![](/files/hsR4ok3152WyAf8J2C1u) CanUndo

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns a value indicating whether the user can undo the previous operation in a text box control.

### ![](/files/lzopMboA31bVq8UIcbT3) DefaultSize

[Size](https://docs.microsoft.com/dotnet/api/system.drawing.size): Returns the default size for a text box control.

### ![](/files/hsR4ok3152WyAf8J2C1u) EnableNativeContextMenu

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Enables or disables the browser's context menu. (Default: `True`)

### ![](/files/hsR4ok3152WyAf8J2C1u) Invalid

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets a value that indicates that the control is invalid.

### ![](/files/hsR4ok3152WyAf8J2C1u) InvalidMessage

[String](https://docs.microsoft.com/dotnet/api/system.string): Returns or sets the invalid message that is shown in the invalid tooltip. (Default: `""`)

### ![](/files/hsR4ok3152WyAf8J2C1u) Label

[LabelWrapper](/api/wisej.web/editors/wisej.web.labelwrapper.md): Provides a label related to the control.

### ![](/files/hsR4ok3152WyAf8J2C1u) LabelText

[String](https://docs.microsoft.com/dotnet/api/system.string): Returns or sets the localizable label associated with this control. (Default: `""`)

### ![](/files/hsR4ok3152WyAf8J2C1u) Lines

[String\[\]](https://docs.microsoft.com/dotnet/api/system.string): Returns or sets the lines of text in a text box control.

### ![](/files/hsR4ok3152WyAf8J2C1u) MaxLength

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns or sets the maximum number of characters the user can type or paste into the text box control. (Default: `0`)

**Throws:**

* [ArgumentOutOfRangeException](https://docs.microsoft.com/dotnet/api/system.argumentoutofrangeexception)\
  The value assigned to the property is less than 0.

### ![](/files/hsR4ok3152WyAf8J2C1u) Modified

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets a value that indicates that the text box control has been modified by the user since the control was created or its contents were last set.

### ![](/files/hsR4ok3152WyAf8J2C1u) Multiline

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether this is a multiline text box control. (Default: `False`)

**Throws:**

* [ArgumentException](https://docs.microsoft.com/dotnet/api/system.argumentexception)\
  The property cannot be modified after the component has been created.

### ![](/files/hsR4ok3152WyAf8J2C1u) ReadOnly

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether the text box control is read-only. (Default: `False`)

### ![](/files/hsR4ok3152WyAf8J2C1u) SelectedText

[String](https://docs.microsoft.com/dotnet/api/system.string): Returns or sets a value indicating the currently selected text in the control.

### ![](/files/hsR4ok3152WyAf8J2C1u) SelectionLength

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns or sets the number of characters selected in the text box.

**Throws:**

* [ArgumentOutOfRangeException](https://docs.microsoft.com/dotnet/api/system.argumentoutofrangeexception)\
  The assigned value is less than -1.

### ![](/files/hsR4ok3152WyAf8J2C1u) SelectionStart

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns or sets the starting point of text selected in the text box.

**Throws:**

* [ArgumentOutOfRangeException](https://docs.microsoft.com/dotnet/api/system.argumentoutofrangeexception)\
  The assigned value is less than zero.

### ![](/files/hsR4ok3152WyAf8J2C1u) SelectOnEnter

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Selects the text when gaining the focus. (Default: `False`)

### ![](/files/hsR4ok3152WyAf8J2C1u) Text

[String](https://docs.microsoft.com/dotnet/api/system.string): Returns or sets the current text in the text box. (Default: `""`)

### ![](/files/hsR4ok3152WyAf8J2C1u) TextLength

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns the length of text in the control.

### ![](/files/hsR4ok3152WyAf8J2C1u) Tools

[ComponentToolCollection](/api/wisej.web/editors/wisej.web.componenttoolcollection.md): Returns the instance of [ComponentToolCollection](/api/wisej.web/editors/wisej.web.componenttoolcollection.md) associated with this control.

### ![](/files/hsR4ok3152WyAf8J2C1u) Watermark

[String](https://docs.microsoft.com/dotnet/api/system.string): Returns or sets the text to show when the textbox is empty. (Default: `null`)

### ![](/files/hsR4ok3152WyAf8J2C1u) WordWrap

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Indicates whether a multiline text box control automatically wraps words to the beginning of the next line when necessary. (Default: `True`)

## Methods

### ![](/files/hsR4ok3152WyAf8J2C1u) AppendText(text)

Appends text to the current text of a text box.

| Parameter | Type                                                          | Description                                                 |
| --------- | ------------------------------------------------------------- | ----------------------------------------------------------- |
| **text**  | [String](https://docs.microsoft.com/dotnet/api/system.string) | The text to append to the current contents of the text box. |

### ![](/files/hsR4ok3152WyAf8J2C1u) Clear()

Clears all text from the text box control.

### ![](/files/hsR4ok3152WyAf8J2C1u) Copy()

Copies the current selection in the text box to the Clipboard.

### ![](/files/hsR4ok3152WyAf8J2C1u) Cut()

Moves the current selection in the text box to the Clipboard.

### ![](/files/hsR4ok3152WyAf8J2C1u) DeselectAll()

Specifies that the value of the [SelectionLength](#selectionlength) property is zero so that no characters are selected in the control.

### ![](/files/lzopMboA31bVq8UIcbT3) Dispose(disposing)

Dispose the control.

| Parameter     | Type                                                            | Description                                                                 |
| ------------- | --------------------------------------------------------------- | --------------------------------------------------------------------------- |
| **disposing** | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) | true when this method is called by the application rather than a finalizer. |

### ![](/files/lzopMboA31bVq8UIcbT3) OnAcceptsTabChanged(e)

Fires the [AcceptsTabChanged](#acceptstabchanged) event.

| Parameter | Type                                                                | Description                                                                                         |
| --------- | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| **e**     | [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) | A [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) that contains the event data. |

### ![](/files/lzopMboA31bVq8UIcbT3) OnModifiedChanged(e)

Fires the [ModifiedChanged](#modifiedchanged) event.

| Parameter | Type                                                                | Description                                                                                         |
| --------- | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| **e**     | [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) | A [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) that contains the event data. |

### ![](/files/lzopMboA31bVq8UIcbT3) OnMultilineChanged(e)

Fires the [MultilineChanged](#multilinechanged) event.

| Parameter | Type                                                                | Description                                                                                         |
| --------- | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| **e**     | [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) | A [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) that contains the event data. |

### ![](/files/lzopMboA31bVq8UIcbT3) OnReadOnlyChanged(e)

Fires the [ReadOnlyChanged](#readonlychanged) event.

| Parameter | Type                                                                | Description                                                                                          |
| --------- | ------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| **e**     | [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) | An [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) that contains the event data. |

### ![](/files/lzopMboA31bVq8UIcbT3) OnToolClick(e)

Fires the ToolClick event.

| Parameter | Type                                                                         | Description                                                                                                  |
| --------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| **e**     | [ToolClickEventArgs](/api/wisej.web/editors/wisej.web.toolclickeventargs.md) | A [ToolClickEventArgs](/api/wisej.web/editors/wisej.web.toolclickeventargs.md) that contains the event data. |

### ![](/files/lzopMboA31bVq8UIcbT3) OnValidating(e)

Fires the [Validating](/api/wisej.web/general/control.md#validating) event.

| Parameter | Type                                                                                           | Description                                                                                         |
| --------- | ---------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| **e**     | [CancelEventArgs](https://docs.microsoft.com/dotnet/api/system.componentmodel.canceleventargs) | A [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) that contains the event data. |

### ![](/files/lzopMboA31bVq8UIcbT3) OnWebEvent(e)

Processes the event from the client.

| Parameter | Type                                                        | Description      |
| --------- | ----------------------------------------------------------- | ---------------- |
| **e**     | [WisejEventArgs](/api/wisej.core/general/wisejeventargs.md) | Event arguments. |

### ![](/files/lzopMboA31bVq8UIcbT3) OnWebRender(config)

Renders the client component.

| Parameter  | Type                                                          | Description                   |
| ---------- | ------------------------------------------------------------- | ----------------------------- |
| **config** | [Object](https://docs.microsoft.com/dotnet/api/system.object) | Dynamic configuration object. |

### ![](/files/lzopMboA31bVq8UIcbT3) OnWebUpdate(state)

Updates the client component using the state information.

| Parameter | Type                                                          | Description           |
| --------- | ------------------------------------------------------------- | --------------------- |
| **state** | [Object](https://docs.microsoft.com/dotnet/api/system.object) | Dynamic state object. |

### ![](/files/hsR4ok3152WyAf8J2C1u) Paste()

Replaces the current selection in the text box with the contents of the Clipboard.

### ![](/files/hsR4ok3152WyAf8J2C1u) ScrollToX(x)

Scrolls to the given left position.

| Parameter | Type                                                        | Description                     |
| --------- | ----------------------------------------------------------- | ------------------------------- |
| **x**     | [Int32](https://docs.microsoft.com/dotnet/api/system.int32) | The horizontal scroll position. |

### ![](/files/hsR4ok3152WyAf8J2C1u) ScrollToY(y)

Scrolls to the given top position.

| Parameter | Type                                                        | Description                   |
| --------- | ----------------------------------------------------------- | ----------------------------- |
| **y**     | [Int32](https://docs.microsoft.com/dotnet/api/system.int32) | The vertical scroll position. |

### ![](/files/hsR4ok3152WyAf8J2C1u) Select(start, length)

Selects a range of text in the text box.

| Parameter  | Type                                                        | Description                                                                            |
| ---------- | ----------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| **start**  | [Int32](https://docs.microsoft.com/dotnet/api/system.int32) | The position of the first character in the current text selection within the text box. |
| **length** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32) | The number of characters to select.                                                    |

**Throws:**

* [ArgumentOutOfRangeException](https://docs.microsoft.com/dotnet/api/system.argumentoutofrangeexception)\
  The value of the *start* parameter is less than zero.

### ![](/files/hsR4ok3152WyAf8J2C1u) SelectAll()

Selects all text in the text box.

### ![](/files/lzopMboA31bVq8UIcbT3) SetBoundsCore(x, y, width, height, specified)

Sets the specified bounds of the [ComboBox](/api/wisej.web/lists-and-grids/combobox.md) control.

| Parameter     | Type                                                                        | Description                                                                                              |
| ------------- | --------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| **x**         | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                 | The new [Left](/api/wisej.web/general/control.md#left) property value of the control.                    |
| **y**         | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                 | The new [Top](/api/wisej.web/general/control.md#top) property value of the control.                      |
| **width**     | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                 | The new [Width](/api/wisej.web/general/control.md#width) property value of the control.                  |
| **height**    | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                 | Not used.                                                                                                |
| **specified** | [BoundsSpecified](/api/wisej.web/enumerations/wisej.web.boundsspecified.md) | A combination of the [BoundsSpecified](/api/wisej.web/enumerations/wisej.web.boundsspecified.md) values. |

## Events

### ![](/files/hsR4ok3152WyAf8J2C1u) AcceptsTabChanged

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Fired when the value of the [AcceptsTab](#acceptstab) property has changed.

### ![](/files/hsR4ok3152WyAf8J2C1u) ModifiedChanged

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Fired when the value of the [Modified](#modified) property has changed.

### ![](/files/hsR4ok3152WyAf8J2C1u) MultilineChanged

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Fired when the value of the [Multiline](#multiline) property has changed.

### ![](/files/hsR4ok3152WyAf8J2C1u) ReadOnlyChanged

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Fired when the value of the [ReadOnly](#readonly) property has changed.

### ![](/files/hsR4ok3152WyAf8J2C1u) ToolClick

[ToolClickEventHandler](/api/wisej.web/editors/wisej.web.toolclickeventhandler.md) Fired when a [ComponentTool](/api/wisej.web/editors/wisej.web.componenttool.md) is clicked.

## Inherited By

| Name                                                                                                                                        | Description                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [MaskedTextBox](/api/wisej.web/editors/maskedtextbox.md)                                                                                    | Uses a mask to distinguish between proper and improper user input.                                                                                                                                                                                                                                                                                                                                                                                |
| [TextBox](/api/wisej.web/editors/wisej.web.textbox.md)                                                                                      | Represents a text box control that allows the user to enter any value.                                                                                                                                                                                                                                                                                                                                                                            |
| [DataGridViewMaskedTextBoxEditingControl](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewmaskedtextboxeditingcontrol.md) | Represents a [MaskedTextBox](/api/wisej.web/editors/maskedtextbox.md) control that can be hosted in a [DataGridViewMaskedTextBoxCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewmaskedtextboxcell.md) cell.                                                                                                                                                                                                               |
| [DataGridViewTextBoxEditingControl](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewtextboxeditingcontrol.md)             | Represents a [TextBox](/api/wisej.web/editors/wisej.web.textbox.md) control that can be hosted in a [DataGridViewTextBoxCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewtextboxcell.md) cell when the cell's [WrapMode](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellstyle.md#wrapmode) is set to [False](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewtristate.md#fields). |
| [TagTextBox](/api/wisej.web/editors/tagtextbox.md)                                                                                          | Represents a data field that displays a list of selectable and removable tags. The control recognizes tags as the user types and adds in front of the editable field.                                                                                                                                                                                                                                                                             |
| [TypedTextBox](/api/wisej.web/editors/wisej.web.typedtextbox.md)                                                                            | Represents a text box control that allows the user to enter a typed value.                                                                                                                                                                                                                                                                                                                                                                        |

## Implements

| Name                                                                              | Description                                                                                                                                                                                                                                     |
| --------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [IUserData](/api/wisej.web/interfaces/wisej.web.iuserdata.md)                     | Provides access to the `UserData` and `Tag` properties associated to the component implementing this interface.                                                                                                                                 |
| [IBindableComponent](/api/wisej.web/data-binding/wisej.web.ibindablecomponent.md) | Bindable components implement this interface.                                                                                                                                                                                                   |
| [IDropTarget](/api/wisej.web/interfaces/wisej.web.idroptarget.md)                 | Controls that support drag & drop operations implement this interface.                                                                                                                                                                          |
| [ILabel](/api/wisej.web/interfaces/wisej.web.ilabel.md)                           | Provides access to the [LabelWrapper](/api/wisej.web/editors/wisej.web.labelwrapper.md) associated with the controls that implement this interface.                                                                                             |
| [IReadOnly](/api/wisej.web/interfaces/wisej.web.ireadonly.md)                     | Provides access to the [ReadOnly](/api/wisej.web/interfaces/wisej.web.ireadonly.md#readonly) property for coontrols that support the read-only mode.                                                                                            |
| [IModified](/api/wisej.web/interfaces/wisej.web.imodified.md)                     | Provides access to the [Modified](/api/wisej.web/interfaces/wisej.web.imodified.md#modified) property and [ModifiedChanged](/api/wisej.web/interfaces/wisej.web.imodified.md#modifiedchanged) event for controls that implement this interface. |
| [IValidation](/api/wisej.web/interfaces/wisej.web.ivalidation.md)                 | Provides access to the validation events and properties property for controls that support validation.                                                                                                                                          |
| [IWisejComponent](/api/wisej.core/interfaces/wisej.core.iwisejcomponent.md)       | All wisej components implement this interface.                                                                                                                                                                                                  |
| [IWisejControl](/api/wisej.core/interfaces/wisej.core.iwisejcontrol.md)           | All wisej controls derived from the [Control](/api/wisej.web/general/control.md) class must implement this interface.                                                                                                                           |
| [IWisejSerializable](/api/wisej.core/interfaces/wisej.core.iwisejserializable.md) | Allows an object to serialize itself.                                                                                                                                                                                                           |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wisej.com/api/wisej.web/editors/wisej.web.textboxbase.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
