Share via


AccessText.FontStyle 属性

定义

获取或设置要用于 AccessText 元素的字体样式。

public:
 property System::Windows::FontStyle FontStyle { System::Windows::FontStyle get(); void set(System::Windows::FontStyle value); };
public System.Windows.FontStyle FontStyle { get; set; }
member this.FontStyle : System.Windows.FontStyle with get, set
Public Property FontStyle As FontStyle

属性值

要使用的字体样式;例如,正常、斜体或倾斜。 默认值由 MessageFontStyle 规格确定。

示例

下面的示例演示如何设置属性以更改控件中 AccessText 文本的外观。

<TextBox Name="textBox2" Width="50" Height="30"/>
<Label Target="{Binding ElementName=textBox2}">
  <AccessText Background="Red" Foreground="DarkSlateBlue"    
              FontFamily="Arial Narrow" FontSize="16" FontStyle="Italic" 
              FontWeight="Bold">
    E_dit
  </AccessText>
</Label>

注解

有关详细信息和字体样式列表,请参阅 FontStyle

依赖项属性信息

标识符字段 FontStyleProperty
元数据属性设置为 true AffectsMeasure, AffectsRender, Inherits

适用于

另请参阅