New to Telerik UI for WinFormsStart a free 30-day trial

Properties

Updated over 6 months ago

RadTextBox shares most of the properties of the standard Windows Forms text box, including:

PropertyDescription
BackColorGets or sets the background color of the control.
ForeColorGets or sets the fore color of the text.
TextGets or sets the current text in the control.
CharacterCasingspecifies whether the user can type upper-case, lower-case, or both.
MaxLengthsets the maximum number of characters that can be typed into the control.
MultiLinecontrols whether multiple lines of text can be displayed in the control.
UseSystemPasswordCharGets or sets a value indicating whether the text should appear as the default password character.
ShowClearButtonGets or sets a value indicating whether the clear button is shown.
NullTextGets or sets the text that is displayed when the textbox contains no text.
ShowNullTextGets or sets a value indicating whether the null text will be shown when the control is focused and the text is empty.
ShowEmbeddedLabelGets or sets a value indicating whether the embedded label is shown.
EmbeddedLabelTextGets or sets the text of the embedded label.

NullText

RadTextBox has a NullText property that is not shared by the standard Windows Forms text box. This property specifies what text to be displayed when the control has no Text value.

Figure 1: Using the null text.

WinForms RadTextBox Using the Null Text

By default, when the control receives focus, this text is automatically removed. This behavior can be controlled by the ShowNullText property. If it is set to true the NullText will be shown even when the text box is focused until you enter some text in the editor.

ShowNullText=falseShowNullText=true
WinForms RadTextBox ShowNullText FalseWinForms RadTextBox ShowNullText True

Since R1 2017 RadTextBox can show a clear button when there is some text in the editor. This is controlled by the ShowClearButton property.

WinForms RadTextBox ShowClearButton

Embedded Labels

Since R2 2021 RadTextBox supports embedded labels. The embedded label shows a text in the text box field usually to indicate what text should the user enter in the text box. When RadTextBox gets focus the embedded label will go up, so the user can type in the text box field. The ShowEmbeddedLabel property controls whether the embedded label is shown. You can set the desired text by using the EmbeddedLabelText property.

Example 1: Setting the embedded label

C#
this.radTextBox1.ShowEmbeddedLabel = true;
this.radTextBox1.EmbeddedLabelText = "First Name";

WinForms RadTextBox Embedded Labels

RadTextBoxElement exposes the following useful properties related to embedded labels. You can access them through the TextBoxElement property:

  • EmbeddedLabel - Gets an instance of the corresponding embedded label.
  • RepositionEmbeddedLabel - Gets or set a value to indicate whether to reposition the embedded label, when text box is empty.
  • EmbeddedLabelAnimationSpeed - Gets or set the animation speed of the embedded label.

The speed is an integer between 1 and 10 (slowest) with default value 8.

See Also

In this article
NullTextEmbedded LabelsSee Also
Not finding the help you need?
Contact Support