Compartilhar via


TextBlock.FontStyle Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets or sets the font style for the content in this element.

Namespace:  System.Windows.Controls
Assembly:  System.Windows (in System.Windows.dll)

Syntax

'Declaration
Public Property FontStyle As FontStyle
public FontStyle FontStyle { get; set; }
<TextBlock FontStyle="fontStylesValue"/>

XAML Values

  • fontStylesValue
    A FontStyles property name, either Normal or Italic.

Property Value

Type: System.Windows.FontStyle
The requested font style, which is a FontStyle that is obtained from one of the FontStyles property values. The default is Normal.

Remarks

Dependency property identifier field: FontStyleProperty

This property can select only from fonts that exist in a font family and the corresponding glyphs. Not all font families have an italic form available. Setting to Italic if using a font family that has no corresponding italic form font does not cause programmatic shear effect applied to the normal font glyphs, and the Normal form is used instead as a fallback. Font fallback behavior does not change the property value, the property will remain as the value you set it to despite whatever visual behavior results due to font fallback.

FontStyle settings for Run child elements override the settings on the containing TextBlock.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.