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

適用於

另請參閱