TextBlock.SetFontStyle(DependencyObject, FontStyle) 方法

定义

设置指定的依赖对象上的 FontStyle 附加属性值。Sets the value of the FontStyle attached property on a specified dependency object.

public:
 static void SetFontStyle(System::Windows::DependencyObject ^ element, System::Windows::FontStyle value);
public static void SetFontStyle (System.Windows.DependencyObject element, System.Windows.FontStyle value);
static member SetFontStyle : System.Windows.DependencyObject * System.Windows.FontStyle -> unit
Public Shared Sub SetFontStyle (element As DependencyObject, value As FontStyle)

参数

element
DependencyObject

要在其上设置 FontStyle 属性值的依赖对象。The dependency object on which to set the value of the FontStyle property.

value
FontStyle

要为属性设置的新值。The new value to set the property to.

异常

elementnullelement is null.

适用于

另请参阅