# TextBox

Namespace: **Wisej.Web**

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

* [Control](https://docs.wisej.com/api/wisej.web/general/control)
  * [TextBoxBase](https://docs.wisej.com/api/wisej.web/editors/wisej.web.textboxbase)
    * [TextBox](https://docs.wisej.com/api/wisej.web/editors/wisej.web.textbox)

Represents a text box control that allows the user to enter any value.

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

```csharp
public class TextBox : TextBoxBase
```

{% endtab %}

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

```visual-basic
Public Class TextBox
    Inherits TextBoxBase
```

{% endtab %}
{% endtabs %}

## Constructors

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) TextBox()

Initializes a new instance of the [TextBox](https://docs.wisej.com/api/wisej.web/editors/wisej.web.textbox) class with default settings.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) TextBox(onTextChanged)

Initializes a new instance of the [TextBox](https://docs.wisej.com/api/wisej.web/editors/wisej.web.textbox) class with specific initial settings.

| Name              | Type                                                                                | Description                                                                                  |
| ----------------- | ----------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| **onTextChanged** | [Action\<Object, EventArgs>](https://docs.microsoft.com/dotnet/api/system.action-2) | Handler for the [TextChanged](https://docs.wisej.com/api/general/control#textchanged) event. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) TextBox(label, onTextChanged)

Initializes a new instance of the [TextBox](https://docs.wisej.com/api/wisej.web/editors/wisej.web.textbox) class with specific initial settings.

| Name              | Type                                                                                | Description                                                                                                         |
| ----------------- | ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| **label**         | [String](https://docs.microsoft.com/dotnet/api/system.string)                       | The initial text to display in the [TextBox](https://docs.wisej.com/api/wisej.web/editors/wisej.web.textbox) label. |
| **onTextChanged** | [Action\<Object, EventArgs>](https://docs.microsoft.com/dotnet/api/system.action-2) | Handler for the [TextChanged](https://docs.wisej.com/api/general/control#textchanged) event.                        |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) TextBox(location, size, onTextChanged)

Initializes a new instance of the [TextBox](https://docs.wisej.com/api/wisej.web/editors/wisej.web.textbox) class with specific initial settings.

| Name              | Type                                                                                | Description                                                                                                          |
| ----------------- | ----------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| **location**      | [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point)                 | The location of the [TextBox](https://docs.wisej.com/api/wisej.web/editors/wisej.web.textbox) on its parent control. |
| **size**          | [Size](https://docs.microsoft.com/dotnet/api/system.drawing.size)                   | The size of the [TextBox](https://docs.wisej.com/api/wisej.web/editors/wisej.web.textbox).                           |
| **onTextChanged** | [Action\<Object, EventArgs>](https://docs.microsoft.com/dotnet/api/system.action-2) | Handler for the [TextChanged](https://docs.wisej.com/api/general/control#textchanged) event.                         |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) TextBox(label, location, size, onTextChanged)

Initializes a new instance of the [TextBox](https://docs.wisej.com/api/wisej.web/editors/wisej.web.textbox) class with specific initial settings.

| Name              | Type                                                                                | Description                                                                                                          |
| ----------------- | ----------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| **label**         | [String](https://docs.microsoft.com/dotnet/api/system.string)                       | The initial text to display in the [TextBox](https://docs.wisej.com/api/wisej.web/editors/wisej.web.textbox) label.  |
| **location**      | [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point)                 | The location of the [TextBox](https://docs.wisej.com/api/wisej.web/editors/wisej.web.textbox) on its parent control. |
| **size**          | [Size](https://docs.microsoft.com/dotnet/api/system.drawing.size)                   | The size of the [TextBox](https://docs.wisej.com/api/wisej.web/editors/wisej.web.textbox).                           |
| **onTextChanged** | [Action\<Object, EventArgs>](https://docs.microsoft.com/dotnet/api/system.action-2) | Handler for the [TextChanged](https://docs.wisej.com/api/general/control#textchanged) event.                         |

## Properties

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) AcceptsReturn

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether pressing ENTER in a multiline [TextBox](https://docs.wisej.com/api/wisej.web/editors/wisej.web.textbox) control creates a new line of text in the control or activates the default accept button for the [Form](https://docs.wisej.com/api/wisej.web/containers/form) or [Page](https://docs.wisej.com/api/wisej.web/containers/wisej.web.page). (Default: `False`)

If there is no accept button for the [Form](https://docs.wisej.com/api/wisej.web/containers/form) or [Page](https://docs.wisej.com/api/wisej.web/containers/wisej.web.page), the ENTER key will always create a new line of text in the control, regardless of the value of this property. If the value of this property is false and there is an accept button defined on the [AcceptButton](https://docs.wisej.com/api/containers/form#acceptbutton) or [AcceptButton](https://docs.wisej.com/api/containers/wisej.web.page#acceptbutton), the user must press SHIFT+ENTER to create a new line in a multiline TextBox control.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) CharacterCasing

[CharacterCasing](https://docs.wisej.com/api/wisej.web/editors/wisej.web.charactercasing): Returns or sets whether the [TextBox](https://docs.wisej.com/api/wisej.web/editors/wisej.web.textbox) control modifies the case of characters as they are typed. (Default: `Normal`)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Checked

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns whether the textbox with [InputType](#inputtype) set to [Checkbox](https://docs.wisej.com/api/wisej.web/wisej.web.textboxtype#fields) or [Radio](https://docs.wisej.com/api/wisej.web/wisej.web.textboxtype#fields) is checked.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Filter

[String](https://docs.microsoft.com/dotnet/api/system.string): Returns or sets a JavaScript regular expression that limits the characters that the user can type. (Default: `null`)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) InputType

[InputType](https://docs.wisej.com/api/wisej.web/editors/wisej.web.inputtype): Specifies the type, min, max and step properties to associate to the \<input> element.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) PasswordChar

[Char](https://docs.microsoft.com/dotnet/api/system.char): Returns or sets the character used to mask characters of a password in a single-line [TextBox](https://docs.wisej.com/api/wisej.web/editors/wisej.web.textbox) control. (Default: `"\0"`)

This property only enables/disables the password mode for the textbox. It doesn't change the password masking character used by the browser.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) ScrollBars

[ScrollBars](https://docs.wisej.com/api/wisej.web/enumerations/wisej.web.scrollbars): Returns or sets which scroll bars should appear. (Default: `Both`)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) SpellCheck

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether the text in the [TextBox](https://docs.wisej.com/api/wisej.web/editors/wisej.web.textbox) is spell checked by the browser. (Default: `False`)

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Text

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

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) TextAlign

[HorizontalAlignment](https://docs.wisej.com/api/wisej.web/enumerations/wisej.web.horizontalalignment): Returns or sets how text is aligned in a [TextBox](https://docs.wisej.com/api/wisej.web/editors/wisej.web.textbox) control. (Default: `Left`)

## Methods

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) OnCheckedChanged(e)

Fires the [CheckedChanged](#checkedchanged) 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. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) OnTextAlignChanged(e)

Fires the [TextAlignChanged](#textalignchanged) 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. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) OnWebEvent(e)

Processes the event from the client.

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

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) OnWebRender(config)

Renders the client component.

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

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) PreProcessValue(value)

Applies any text transformation before saving the text property.

| Parameter | Type                                                          | Description                                         |
| --------- | ------------------------------------------------------------- | --------------------------------------------------- |
| **value** | [String](https://docs.microsoft.com/dotnet/api/system.string) | Value to process before it's stored in the control. |

**Returns:** [String](https://docs.microsoft.com/dotnet/api/system.string). The value store in the control.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) ResetInputType()

Resets the [InputType](#inputtype) property.

## Events

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) CheckedChanged

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Fired when the value of the [Checked](#checked) property changes.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) TextAlignChanged

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

## Inherited By

| Name                                                                                                                                               | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| -------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [DataGridViewTextBoxEditingControl](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewtextboxeditingcontrol) | Represents a [TextBox](https://docs.wisej.com/api/wisej.web/editors/wisej.web.textbox) control that can be hosted in a [DataGridViewTextBoxCell](https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewtextboxcell) cell when the cell's [WrapMode](https://docs.wisej.com/api/lists-and-grids/datagridview/wisej.web.datagridviewcellstyle#wrapmode) is set to [False](https://docs.wisej.com/api/lists-and-grids/datagridview/wisej.web.datagridviewtristate#fields). |
| [TypedTextBox](https://docs.wisej.com/api/wisej.web/editors/wisej.web.typedtextbox)                                                                | Represents a text box control that allows the user to enter a typed value.                                                                                                                                                                                                                                                                                                                                                                                                                                |

## Implements

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