This documentation is archived and is not being maintained.

Run.Text Property

Gets or sets the unformatted text contents of this text Run.

Namespace:  System.Windows.Documents
Assembly:  PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation

'Declaration
Public Property Text As String
'Usage
Dim instance As Run 
Dim value As String 

value = instance.Text

instance.Text = value
<object>
  <string .../>
</object>

Property Value

Type: System.String
A string specifying the unformatted text contents of this text Run. The default is Empty.

The following example shows how to set the Text attribute of a Run element.

<FlowDocument>
  <Paragraph>
    <Run Text="The text contents of this text run."/>
  </Paragraph>
</FlowDocument>

Alternately, the contents of a text run may simply be contained by Run element tags.

<FlowDocument>
  <Paragraph>
    <Run>
      The text contents of this text run.
    </Run>
  </Paragraph>
</FlowDocument>

The following example shows how to set the Text property programmatically.

Run textRun = new Run();
textRun.Text = "The text contents of this text run.";

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0
Show: