TextBox Content Model Overview

This content model overview describes the supported content for a TextBox. A TextBox is a control that can be used to display or edit unformatted text. A TextBox supports unformatted text only. For applications that require support for richer content, see RichTextBox.

The following graphic shows an example of a TextBox.

Example of a TextBox

TextBox screen shot

This topic contains the following sections.

  • TextBox Content Property
  • Using the Text Property
  • Types That Share This Content Model
  • Types That Can Contain Decorator Objects
  • Related Topics

TextBox Content Property

A TextBox has the following content properties.

Using the Text Property

The Text property specifies the unformatted text contained within the TextBox. The following example shows how to use the Text property to add some unformatted text to a TextBox.

tbSettingText.Text = "Initial text contents of the TextBox."
tbSettingText.Text = "Initial text contents of the TextBox.";

Types That Share This Content Model

Only TextBox uses this content model.

Types That Can Contain Decorator Objects

See WPF Content Model.

See Also

Concepts

RichTextBox Overview

TextBox Overview