Text box controls allow entering text on a form at runtime. By default, it takes a single line of text, however, you can make it accept multiple texts and even add scroll bars to it.
- TextAlign :- Gets or sets how text is aligned in a TextBox control.
- Multiline: – Gets or sets a value indicating whether this is a multiline TextBox control.
- MaxLength :- Gets or sets the maximum number of characters the user can type or paste into the text box control.
- HideSelection :- Gets or sets a value indicating whether the selected text in the text box control remains highlighted when the control loses focus.
- PasswordChar:- Gets or sets the character used to mask characters of a password in a single-line.
- TextLength :- Gets the length of text in the control.
- WordWrap :- Indicates whether a multiline text box control automatically wraps words to the beginning of the next line when necessary.
1. AppendText : Appends text to the current text of a text box.
You can use this method to add text to the existing text in the TextBox control instead of using the concatenation operator (+). It works faster when content of text is more.
For example, adds the text OM to the existing text of the textbox1.
2. Clear :Clears all text from the text box control.
For example, to clear all the contents of the text box1,
3. Copy: This method Copies the selected text from the TextBox control to the Clipboard.
For example, to copy the selected text from the TextBox1 to the Clipboard,
4. Cut: This method removes (Moves) the selected text from the TextBox control to the Clipboard.
For example, to removes (Moves) the selected text from the TextBox1 to the Clipboard,
5. Paste: This method replaces the selected text in the TextBox with the text from the Clipboard.
6. SelectAll: This method is used to Selects all text in the text box.
1. TextChanged : This is the default event of the Textbox control. It is triggered (fires or executes)when the text in the TextBox is changed.