FormattedText.SetFontStyle Method (FontStyle, Int32, Int32)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Sets the font style for a specified subset of characters in the FormattedText object.

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

member SetFontStyle : 
        style:FontStyle *
        startIndex:int *
        count:int -> unit

Parameters

style
Type: System.Windows.FontStyle

The FontStyle value to use for text formatting.

startIndex
Type: System.Int32

The start index of the initial character to apply the font style to.

count
Type: System.Int32

The number of characters to apply the font style to.

FontStyle supports type conversion behavior such that static values of the FontStyles class can be used to initialize FontStyle and fill parameters that are type FontStyle.

To set the font style for the entire text string, use the SetFontStyle(FontStyle) method.

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

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

.NET Framework
Available since 3.0
Return to top
Show: