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)

member SetForegroundBrush : 
        foregroundBrush:Brush *
        startIndex:int *
        count:int -> unit

Parameters

foregroundBrush
Type: System.Windows.Media.Brush

The brush to use for the text foreground.

startIndex
Type: System.Int32

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

count
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
Available since 3.0
Return to top
Show: