FlowDocument.Foreground FlowDocument.Foreground FlowDocument.Foreground FlowDocument.Foreground Property


Brush のテキスト コンテンツに適用する FlowDocument を取得または設定します。Gets or sets the Brush to apply to the text contents of the FlowDocument.

 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


テキスト コンテンツに適用するブラシ。The brush used to apply to the text contents. 既定値は、Black です。The default is Black.

要素の属性Foregroundを設定する方法を次の例に示します。 FlowDocumentThe following example shows how to set the Foreground attribute of a FlowDocument element.

      This FlowDocument will have a background color of Indian red, with the text
      colored Navajo white.  Any Forground or Background settings on this paragraph
      would override the top-level settings for the FlowDocument.

次の例では、プログラムをForeground使用してプロパティを設定する方法を示します。The following example shows how to set the Foreground property programmatically.

FlowDocument flowDoc = new FlowDocument(new Paragraph(new Run("A bit of text content...")));
flowDoc.Background = Brushes.IndianRed;
flowDoc.Foreground = Brushes.NavajoWhite;
Dim flowDoc As New FlowDocument(New Paragraph(New Run("A bit of text content...")))
flowDoc.Background = Brushes.IndianRed
flowDoc.Foreground = Brushes.NavajoWhite


使用できる定義済みのブラシの色を示す見本の表にBrushesついては、「」を参照してください。For a table of swatches that shows the available predefined brush colors, see Brushes.

Foreground要素の設定は、この最上位レベルの設定よりも優先されます。Any Foreground settings on child elements override this top-level setting.

依存プロパティ情報Dependency Property Information

識別子フィールドIdentifier field ForegroundProperty
メタデータプロパティがに設定されるtrueMetadata properties set to true AffectsRender, Inherits,AffectsRender, Inherits,