Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

Text Property

Visual Studio .NET 2003

Contains the unformatted text entered in the textbox portion of a control. Not available at design time; read-only at run time.

Object.Text

Remarks

Unlike the Value property, the value contained in the Text property is unformatted and is identical to the text entered in the control by the user.

The unformatted text contained in a control's Text property can differ from the control's Value property for the following reasons:

  • The Value property may not be of Character type; it may contain a Date or Numeric value.
  • For an edit box, the Value property may add line feeds to the text entered in the edit box, providing compatibility with previous versions. For this reason, using the Text property is the preferred method for selecting text with the SelStart and SelLength properties.
  • If the Format property for the control uses the R setting, input mask characters are removed from the Value property.

If the Style property for a combo box control is set to 2 (Drop-down List), the Text property contains the empty string because the ComboBox does not have a text box.

See Also

Format Property | SelStart Property | SelLength Property | Style Property | Value Property

Applies To: ComboBox | EditBox | Spinner | TextBox

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.