TextBox
Namespace: Wisej.Web
Assembly: Wisej.Framework (4.1.0.0)
Represents a text box control that allows the user to enter any value.
- C#
- VB.NET
public class TextBox : TextBoxBase
Public Class TextBox
Inherits TextBoxBase
Constructors
TextBox()
Initializes a new instance of the TextBox class with default settings.
TextBox(onTextChanged)
Initializes a new instance of the TextBox class with specific initial settings.
| Name | Type | Description |
|---|---|---|
| onTextChanged | Action<Object, EventArgs> | Handler for the TextChanged event. |
TextBox(label, onTextChanged)
Initializes a new instance of the TextBox class with specific initial settings.
| Name | Type | Description |
|---|---|---|
| label | String | The initial text to display in the TextBox label. |
| onTextChanged | Action<Object, EventArgs> | Handler for the TextChanged event. |
TextBox(location, size, onTextChanged)
Initializes a new instance of the TextBox class with specific initial settings.
| Name | Type | Description |
|---|---|---|
| location | Point | The location of the TextBox on its parent control. |
| size | Size | The size of the TextBox. |
| onTextChanged | Action<Object, EventArgs> | Handler for the TextChanged event. |
TextBox(label, location, size, onTextChanged)
Initializes a new instance of the TextBox class with specific initial settings.
| Name | Type | Description |
|---|---|---|
| label | String | The initial text to display in the TextBox label. |
| location | Point | The location of the TextBox on its parent control. |
| size | Size | The size of the TextBox. |
| onTextChanged | Action<Object, EventArgs> | Handler for the TextChanged event. |
Properties
AcceptsReturn
Boolean: Returns or sets whether pressing ENTER in a multiline TextBox control creates a new line of text in the control or activates the default accept button for the Form or Page. (Default: False)
Value: true if the ENTER key creates a new line of text when Multiline is true; false if the ENTER key activates the default button for the form. The default is false.
If there is no accept button for the Form or 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 or AcceptButton, the user must press SHIFT+ENTER to create a new line in a multiline TextBox control.
CharacterCasing
CharacterCasing: Returns or sets whether the TextBox control modifies the case of characters as they are typed. (Default: Normal)
Value: One of the CharacterCasing enumeration values that specifies whether the TextBox control modifies the case of characters. The default is CharacterCasing.Normal.
Checked
Boolean: Returns whether the textbox with InputType set to Checkbox or Radio is checked.
Filter
String: Returns or sets a JavaScript regular expression that limits the characters that the user can type. (Default: null)
InputType
InputType: Specifies the type, min, max and step properties to associate to the <input> element.
PasswordChar
Char: Returns or sets the character used to mask characters of a password in a single-line TextBox control. (Default: "\0")
Value: The character used to mask characters entered in a single-line TextBox control. Set the value of this property to 0 (character value) if you do not want the control to mask characters as they are typed. Equals 0 (character value) by default.
This property only enables/disables the password mode for the textbox. It doesn't change the password masking character used by the browser.
ScrollBars
ScrollBars: Returns or sets which scroll bars should appear. (Default: Both)
Value: One of the ScrollBars enumeration values that indicates whether the control appears with no scroll bars, a horizontal scroll bar, a vertical scroll bar, or both. The default is ScrollBars.None.
SpellCheck
Boolean: Returns or sets whether the text in the TextBox is spell checked by the browser. (Default: False)
Value: true if the text is spell checked.
Text
String: Returns or sets the current text in the text box. (Default: "")
Value: The text displayed in the control.
TextAlign
HorizontalAlignment: Returns or sets how text is aligned in a TextBox control. (Default: Left)
Value: One of the HorizontalAlignment enumeration values that specifies how text is aligned in the control. The default is HorizontalAlignment.Left.
Methods
OnCheckedChanged(e)
Fires the CheckedChanged event.
OnTextAlignChanged(e)
Fires the TextAlignChanged event.
OnWebEvent(e)
Processes the event from the client.
| Parameter | Type | Description |
|---|---|---|
| e | WisejEventArgs | Event arguments. |
OnWebRender(config)
Renders the client component.
| Parameter | Type | Description |
|---|---|---|
| config | Object | Dynamic configuration object. |
PreProcessValue(value)
Applies any text transformation before saving the text property.
| Parameter | Type | Description |
|---|---|---|
| value | String | Value to process before it's stored in the control. |
Returns: String. The value store in the control.
ResetInputType()
Resets the InputType property.
Events
CheckedChanged
EventHandler Fired when the value of the Checked property changes.
TextAlignChanged
EventHandler Fired when the value of the TextAlign property has changed.
Inherited By
| Name | Description |
|---|---|
| DataGridViewTextBoxEditingControl | Represents a TextBox control that can be hosted in a DataGridViewTextBoxCell cell when the cell's WrapMode is set to False. |
| TypedTextBox | Represents a text box control that allows the user to enter a typed value. |
Implements
| Name | Description |
|---|---|
| IUserData | Provides access to the UserData and Tag properties associated to the component implementing this interface. |
| IBindableComponent | Bindable components implement this interface. |
| IDropTarget | Controls that support drag & drop operations implement this interface. |
| ILabel | Provides access to the LabelWrapper associated with the controls that implement this interface. |
| IReadOnly | Provides access to the ReadOnly property for coontrols that support the read-only mode. |
| IModified | Provides access to the Modified property and ModifiedChanged event for controls that implement this interface. |
| IValidation | Provides access to the validation events and properties property for controls that support validation. |
| IWisejComponent | All wisej components implement this interface. |
| IWisejControl | All wisej controls derived from the Control class must implement this interface. |
| IWisejSerializable | Allows an object to serialize itself. |