TextBoxBase
Namespace: Wisej.Web
Assembly: Wisej.Framework (4.1.0.0)
Implements the basic functionality required by text controls.
- C#
- VB.NET
public abstract class TextBoxBase : Control, IModified, ILabel, IReadOnly, IValidation
Public MustInherit Class TextBoxBase
Inherits Control
Implements IModified, ILabel, IReadOnly, IValidation
Constructors
TextBoxBase()
Initializes an instance of a TextBoxBase derived control.
Properties
AcceptsTab
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)
Value: true if users can enter tabs in a multiline text box using the TAB key; false if pressing the TAB key moves the focus. The default is false.
The Multiline property must be true to get a TAB character in the control.
AutoComplete
AutoComplete: Returns of sets whether the browser can auto complete the field with values previously entered by the user. (Default: Default)
AutoCompleteList
String[]: Identifies a list of pre-defined options to suggest to the user. (Default: null)
AutoSize
Boolean: Returns or sets whether the height of the control is set automatically. (Default: True)
Value: true if the height of the control automatically adjusts to the font and the theme; otherwise, false. The default is true.
BorderStyle
BorderStyle: Returns or sets the border type of the text box control. (Default: Solid)
Value: A BorderStyle that represents the border type of the text box control. The default is Solid.
CanUndo
Boolean: Returns a value indicating whether the user can undo the previous operation in a text box control.
Value: true if the user can undo the previous operation performed in a text box control; otherwise, false.
DefaultSize
Size: Returns the default size for a text box control.
EnableNativeContextMenu
Boolean: Enables or disables the browser's context menu. (Default: True)
Invalid
Boolean: Returns or sets a value that indicates that the control is invalid.
InvalidMessage
String: Returns or sets the invalid message that is shown in the invalid tooltip. (Default: "")
Value: The text displayed in the invalid tooltip.
Label
LabelWrapper: Provides a label related to the control.
LabelText
String: Returns or sets the localizable label associated with this control. (Default: "")
Lines
String[]: Returns or sets the lines of text in a text box control.
Value: An array of strings that contains the text in a text box control.
MaxLength
Int32: Returns or sets the maximum number of characters the user can type or paste into the text box control. (Default: 0)
Value: The number of characters that can be entered into the control. The default is 0 (unlimited).
Throws:
- ArgumentOutOfRangeException The value assigned to the property is less than 0.
Modified
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.
Value: true if the control's contents have been modified; otherwise, false. The default is false.
Multiline
Boolean: Returns or sets whether this is a multiline text box control. (Default: False)
Value: true if the control is a multiline text box control; otherwise, false. The default is false.
Throws:
- ArgumentException The property cannot be modified after the component has been created.
ReadOnly
Boolean: Returns or sets whether the text box control is read-only. (Default: False)
Value: true if the text box is read-only; otherwise, false. The default is false.
SelectedText
String: Returns or sets a value indicating the currently selected text in the control.
Value: A string that represents the currently selected text in the text box.
SelectionLength
Int32: Returns or sets the number of characters selected in the text box.
Value: The number of characters selected in the text box.
Throws:
- ArgumentOutOfRangeException The assigned value is less than -1.
SelectionStart
Int32: Returns or sets the starting point of text selected in the text box.
Value: The starting position of text selected in the text box.
Throws:
- ArgumentOutOfRangeException The assigned value is less than zero.
SelectOnEnter
Boolean: Selects the text when gaining the focus. (Default: False)
Value: true if the text is selected when the text field gains the focus; otherwise, false. The default is false.
Text
String: Returns or sets the current text in the text box. (Default: "")
Value: The text displayed in the control.
TextLength
Int32: Returns the length of text in the control.
Value: The number of characters contained in the control.
Tools
ComponentToolCollection: Returns the instance of ComponentToolCollection associated with this control.
Watermark
String: Returns or sets the text to show when the textbox is empty. (Default: null)
WordWrap
Boolean: Indicates whether a multiline text box control automatically wraps words to the beginning of the next line when necessary. (Default: True)
Value: true if the multiline text box control wraps words; false if the text box control automatically scrolls horizontally when the user types past the right edge of the control. The default is true.
Methods
AppendText(text)
Appends text to the current text of a text box.
| Parameter | Type | Description |
|---|---|---|
| text | String | The text to append to the current contents of the text box. |
Clear()
Clears all text from the text box control.
Copy()
Copies the current selection in the text box to the Clipboard.
Cut()
Moves the current selection in the text box to the Clipboard.
DeselectAll()
Specifies that the value of the SelectionLength property is zero so that no characters are selected in the control.
Dispose(disposing)
Dispose the control.
| Parameter | Type | Description |
|---|---|---|
| disposing | Boolean | true when this method is called by the application rather than a finalizer. |
OnAcceptsTabChanged(e)
Fires the AcceptsTabChanged event.
OnModifiedChanged(e)
Fires the ModifiedChanged event.
OnMultilineChanged(e)
Fires the MultilineChanged event.
OnReadOnlyChanged(e)
Fires the ReadOnlyChanged event.
OnToolClick(e)
Fires the ToolClick event.
| Parameter | Type | Description |
|---|---|---|
| e | ToolClickEventArgs | A ToolClickEventArgs that contains the event data. |
OnValidating(e)
Fires the Validating event.
| Parameter | Type | Description |
|---|---|---|
| e | CancelEventArgs | A EventArgs that contains the event data. |
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. |
OnWebUpdate(state)
Updates the client component using the state information.
| Parameter | Type | Description |
|---|---|---|
| state | Object | Dynamic state object. |
Paste()
Replaces the current selection in the text box with the contents of the Clipboard.
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.
ScrollToX(x)
Scrolls to the given left position.
| Parameter | Type | Description |
|---|---|---|
| x | Int32 | The horizontal scroll position. |
ScrollToY(y)
Scrolls to the given top position.
| Parameter | Type | Description |
|---|---|---|
| y | Int32 | The vertical scroll position. |
Select(start, length)
Selects a range of text in the text box.
| Parameter | Type | Description |
|---|---|---|
| start | Int32 | The position of the first character in the current text selection within the text box. |
| length | Int32 | The number of characters to select. |
Throws:
- ArgumentOutOfRangeException The value of the start parameter is less than zero.
SelectAll()
Selects all text in the text box.
SetBoundsCore(x, y, width, height, specified)
Sets the specified bounds of the ComboBox control.
| Parameter | Type | Description |
|---|---|---|
| x | Int32 | The new Left property value of the control. |
| y | Int32 | The new Top property value of the control. |
| width | Int32 | The new Width property value of the control. |
| height | Int32 | Not used. |
| specified | BoundsSpecified | A combination of the BoundsSpecified values. |
Events
AcceptsTabChanged
EventHandler Fired when the value of the AcceptsTab property has changed.
ModifiedChanged
EventHandler Fired when the value of the Modified property has changed.
MultilineChanged
EventHandler Fired when the value of the Multiline property has changed.
ReadOnlyChanged
EventHandler Fired when the value of the ReadOnly property has changed.
ToolClick
ToolClickEventHandler Fired when a ComponentTool is clicked.
Inherited By
| Name | Description |
|---|---|
| MaskedTextBox | Uses a mask to distinguish between proper and improper user input. |
| TextBox | Represents a text box control that allows the user to enter any value. |
| DataGridViewMaskedTextBoxEditingControl | Represents a MaskedTextBox control that can be hosted in a DataGridViewMaskedTextBoxCell cell. |
| DataGridViewTextBoxEditingControl | Represents a TextBox control that can be hosted in a DataGridViewTextBoxCell cell when the cell's WrapMode is set to False. |
| 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 | 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. |