# TextBoxBase

URL: https://docs.wisej.com/api/wisej.web/editors/wisej.web.textboxbase

Version: 4.1
Namespace: **Wisej.Web**

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

- Control
- [TextBoxBase](/api/wisej.web/editors/wisej.web.textboxbase)
Implements the basic functionality required by text controls.

- C# - VB.NET

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

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

## Constructors

### ![Instance member](/img/api/instance.png) TextBoxBase()

Initializes an instance of a TextBoxBase derived control.

## Properties

### ![Instance member](/img/api/instance.png) 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](/api/wisej.web/editors/wisej.web.textboxbase#multiline) property must be true to get a TAB character in the control.

### ![Instance member](/img/api/instance.png) AutoComplete

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

### ![Instance member](/img/api/instance.png) AutoCompleteList

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

### ![Instance member](/img/api/instance.png) AutoSize

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

### ![Instance member](/img/api/instance.png) BorderStyle

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

### ![Instance member](/img/api/instance.png) 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.

### ![Protected member](/img/api/protected.png) DefaultSize

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

### ![Instance member](/img/api/instance.png) EnableNativeContextMenu

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

### ![Instance member](/img/api/instance.png) Invalid

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

### ![Instance member](/img/api/instance.png) InvalidMessage

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

### ![Instance member](/img/api/instance.png) Label

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

### ![Instance member](/img/api/instance.png) LabelText

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

### ![Instance member](/img/api/instance.png) Lines

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

### ![Instance member](/img/api/instance.png) 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.

### ![Instance member](/img/api/instance.png) 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.

### ![Instance member](/img/api/instance.png) 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.

### ![Instance member](/img/api/instance.png) ReadOnly

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

### ![Instance member](/img/api/instance.png) SelectedText

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

### ![Instance member](/img/api/instance.png) 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.

### ![Instance member](/img/api/instance.png) 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.

### ![Instance member](/img/api/instance.png) SelectOnEnter

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

### ![Instance member](/img/api/instance.png) Text

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

### ![Instance member](/img/api/instance.png) TextLength

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

### ![Instance member](/img/api/instance.png) Tools

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

### ![Instance member](/img/api/instance.png) Watermark

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

### ![Instance member](/img/api/instance.png) 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

### ![Instance member](/img/api/instance.png) 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. 

### ![Instance member](/img/api/instance.png) Clear()

Clears all text from the text box control.

### ![Instance member](/img/api/instance.png) Copy()

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

### ![Instance member](/img/api/instance.png) Cut()

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

### ![Instance member](/img/api/instance.png) DeselectAll()

Specifies that the value of the [SelectionLength](/api/wisej.web/editors/wisej.web.textboxbase#selectionlength) property is zero so that no characters are selected in the control.

### ![Protected member](/img/api/protected.png) 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. 

### ![Protected member](/img/api/protected.png) OnAcceptsTabChanged(e)

Fires the [AcceptsTabChanged](/api/wisej.web/editors/wisej.web.textboxbase#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. 

### ![Protected member](/img/api/protected.png) OnModifiedChanged(e)

Fires the [ModifiedChanged](/api/wisej.web/editors/wisej.web.textboxbase#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. 

### ![Protected member](/img/api/protected.png) OnMultilineChanged(e)

Fires the [MultilineChanged](/api/wisej.web/editors/wisej.web.textboxbase#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. 

### ![Protected member](/img/api/protected.png) OnReadOnlyChanged(e)

Fires the [ReadOnlyChanged](/api/wisej.web/editors/wisej.web.textboxbase#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. 

### ![Protected member](/img/api/protected.png) OnToolClick(e)

Fires the ToolClick event.

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

### ![Protected member](/img/api/protected.png) OnValidating(e)

Fires the [Validating](/api/wisej.web/general/control/#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. 

### ![Protected member](/img/api/protected.png) OnWebEvent(e)

Processes the event from the client.

| Parameter | Type | Description | **e** | WisejEventArgs | Event arguments. 

### ![Protected member](/img/api/protected.png) OnWebRender(config)

Renders the client component.

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

### ![Protected member](/img/api/protected.png) 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. 

### ![Instance member](/img/api/instance.png) Paste()

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

### ![Instance member](/img/api/instance.png) 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. 

### ![Instance member](/img/api/instance.png) 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. 

### ![Instance member](/img/api/instance.png) 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.

### ![Instance member](/img/api/instance.png) SelectAll()

Selects all text in the text box.

### ![Protected member](/img/api/protected.png) SetBoundsCore(x, y, width, height, specified)

Sets the specified bounds of theComboBox control.

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

## Events

### ![Instance member](/img/api/instance.png) AcceptsTabChanged

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

### ![Instance member](/img/api/instance.png) ModifiedChanged

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

### ![Instance member](/img/api/instance.png) MultilineChanged

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

### ![Instance member](/img/api/instance.png) ReadOnlyChanged

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

### ![Instance member](/img/api/instance.png) ToolClick

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

## Inherited By

| Name | Description | MaskedTextBox | Uses a mask to distinguish between proper and improper user input. | [TextBox](/api/wisej.web/editors/wisej.web.textbox) | Represents a text box control that allows the user to enter any value. | [DataGridViewMaskedTextBoxEditingControl](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewmaskedtextboxeditingcontrol) | Represents aMaskedTextBox control that can be hosted in a [DataGridViewMaskedTextBoxCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewmaskedtextboxcell) cell. | [DataGridViewTextBoxEditingControl](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewtextboxeditingcontrol) | Represents a [TextBox](/api/wisej.web/editors/wisej.web.textbox) control that can be hosted in a [DataGridViewTextBoxCell](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewtextboxcell) cell when the cell's [WrapMode](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewcellstyle#wrapmode) is set to [False](/api/wisej.web/lists-and-grids/datagridview/wisej.web.datagridviewtristate#fields) . | TagTextBox | 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) | 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) | Provides access to the `UserData` and `Tag` properties associated to the component implementing this interface. | [IBindableComponent](/api/wisej.web/data-binding/wisej.web.ibindablecomponent) | Bindable components implement this interface. | [IDropTarget](/api/wisej.web/interfaces/wisej.web.idroptarget) | Controls that support drag & drop operations implement this interface. | [ILabel](/api/wisej.web/interfaces/wisej.web.ilabel) | Provides access to the [LabelWrapper](/api/wisej.web/editors/wisej.web.labelwrapper) associated with the controls that implement this interface. | [IReadOnly](/api/wisej.web/interfaces/wisej.web.ireadonly) | Provides access to the [ReadOnly](/api/wisej.web/interfaces/wisej.web.ireadonly#readonly) property for coontrols that support the read-only mode. | [IModified](/api/wisej.web/interfaces/wisej.web.imodified) | Provides access to the [Modified](/api/wisej.web/interfaces/wisej.web.imodified#modified) property and [ModifiedChanged](/api/wisej.web/interfaces/wisej.web.imodified#modifiedchanged) event for controls that implement this interface. | [IValidation](/api/wisej.web/interfaces/wisej.web.ivalidation) | Provides access to the validation events and properties property for controls that support validation. | [IWisejComponent](/api/wisej.core/interfaces/wisej.core.iwisejcomponent) | All wisej components implement this interface. | [IWisejControl](/api/wisej.core/interfaces/wisej.core.iwisejcontrol) | All wisej controls derived from theControl class must implement this interface. | [IWisejSerializable](/api/wisej.core/interfaces/wisej.core.iwisejserializable) | Allows an object to serialize itself.
