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.

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

プロパティ値

テキスト コンテンツに適用するブラシ。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.

<FlowDocumentReader>
  <FlowDocument 
    Background="IndianRed"
    Foreground="NavajoWhite"
  >
    <Paragraph>
      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.
    </Paragraph>
  </FlowDocument>
</FlowDocumentReader>

次の例では、プログラムを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,

SubPropertiesDoNotAffectRender

適用対象