Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

FormattedText::SetForegroundBrush Method (Brush, Int32, Int32)

Changes the foreground Brush for specified text within a FormattedText object.

Namespace:  System.Windows.Media
Assembly:  PresentationCore (in PresentationCore.dll)

void SetForegroundBrush(
	Brush^ foregroundBrush, 
	int startIndex, 
	int count


Type: System.Windows.Media::Brush

The brush to use for the text foreground.

Type: System::Int32

The start index of the initial character to apply the foreground brush to.

Type: System::Int32

The number of characters to apply the foreground brush to.

To set the foreground brush for the entire text string, use the SetForegroundBrush method.

The following example creates a FormattedText object and then applies several formatting styles to the text, including SetForegroundBrush.

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

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
© 2015 Microsoft