Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

TextBlock::Inlines Property

Gets an InlineCollection containing the top-level Inline elements that comprise the contents of the TextBlock.

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

public:
property InlineCollection^ Inlines {
	InlineCollection^ get ();
}
<object>
  <InlineCollection .../>
</object>

Property Value

Type: System.Windows.Documents::InlineCollection
An InlineCollection containing the Inline elements that comprise the contents of the TextBlock.

Use the InlineCollection returned by this property to enumerate or manipulate the contents of a TextBlock.

These examples demonstrate some of the more common operations that can be performed on inline flow content elements (and containers of such elements, such as TextBlock) through the Inlines property. This property is used to add and remove items from InlineCollection. Flow content elements that feature an Inlines property include:

These examples happen to use Span as the flow content element, but these techniques are applicable to all elements or controls that host an InlineCollection collection.

The following example creates a new Span object, and then uses the Add method to add two text runs as content children of the Span.

No code example is currently available or this language may not be supported.

The following example creates a new Run element and inserts it at the beginning of the Span.

No code example is currently available or this language may not be supported.

The following example gets the number of top-level Inline elements contained in the Span.

No code example is currently available or this language may not be supported.

The following example deletes the last Inline element in the Span.

No code example is currently available or this language may not be supported.

The following example clears all of the contents (Inline elements) from the Span.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Show:
© 2014 Microsoft