TextBlock

The TextBlock control allows you to put text on the screen as an alternative to the Label control. Typically, the Label control is used is for short, one-line text (and sometimes images), while the TextBlock is used for multi-line strings and is a text-only control.

TextBlocks are ideal if you need to provide detailed instructions, error or warning messages to the user, however they should not be over-used.

Note that a TextBlock is not editable at runtime. It is simply a multi-line rich text label. To create an editable TextBox, see TextBox.

Properties

The key properties of a TextBlock include:

Scripting Syntax

The properties of a control include events. Scripts can be used to set the properties of a control or be used to trigger an action associated with an event. For a TextBlock:

Create a TextBlock