When a user clicks the "X", the text in the text box is cleared. The clear all button is shown only for editable, single-line text boxes that contain text and have focus. Use the Selection Start and Selection Length properties, and the Select and Select All methods, to manipulate the text selection.The clear all button is not shown in any of these cases: You can make a text box read-only by setting the Is Read Only property to true. Handle the Selection Changed event to do something when the user selects or de-selects text.The text displays on the screen in a simple, uniform, plaintext format.Text Box has a number of features that can simplify text entry.Use a Rich Edit Box to display and edit rich text files. You typically use an event like a submit button click to access the Text property, but you can handle the Text Changed or Text Changing event if you need to do something when the text changes.For more info about choosing the right text control, see the Text controls article. You can add a Header (or label) and Placeholder Text (or watermark) to the text box to give the user an indication of what the text box is for. Add(text Box); The resulting text box looks like this.Note Text Box and Rich Edit Box don't support the Wrap Whole Words value for their Text Wrapping properties. For example, if a text box is used only to enter a 4-digit PIN, set the Input Scope property to Number.If you try to use Wrap Whole Words as a value for Text Box. Text Wrapping an invalid argument exception is thrown. This tells the system to show the number keypad layout, which makes it easier for the user to enter the PIN.
You typically set both properties to make a multi-line text box. The input scope provides a hint to the system about the type of text input expected by the control so the system can provide a specialized touch keyboard layout for the input type.
It comes with a familiar, built-in context menu with support for copying and pasting text.
The "clear all" button lets a user quickly delete all text that has been entered.
You typically toggle this property in your app code based on conditions in your app. You can change the color used to highlight the selected text by setting the Selection Highlight Color property. You can provide custom handling of the Paste event on editable text controls in your app.
If need text that is always read-only, consider using a Text Block instead. For example, you might remove the line breaks from a multi-line address when pasting it into a single-line search box.