Share via


AccessText.Foreground 属性

定义

获取或设置用于绘制元素的文本内容的 Brush

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

属性值

用于绘制文本的 Brush。 默认值为 Black

示例

以下示例演示如何设置属性以更改控件中 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>

注解

依赖项属性信息

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

适用于

另请参阅