Freigeben über


FlowDocument.FontStyle Eigenschaft

Definition

Dient zum Abrufen oder Festlegen des Schriftschnitts der obersten Ebene für die FlowDocument.

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

Eigenschaftswert

Ein Element der FontStyles Klasse, das den gewünschten Schriftschnitt angibt. Der Standardwert wird durch den MessageFontStyle Wert bestimmt.

Beispiele

Das folgende Beispiel zeigt, wie das FontStyle Attribut eines FlowDocument Elements festgelegt wird.

<FlowDocumentReader>
  <FlowDocument
    FontFamily="Century Gothic"
    FontSize="12"
    FontStretch="UltraExpanded"
    FontStyle="Italic"
    FontWeight="UltraBold"
  >
    <Paragraph>
      Any font settings on this paragraph would override the font settings
      for the FlowDocument.
    </Paragraph>
  </FlowDocument>
</FlowDocumentReader>

Das folgende Beispiel zeigt, wie die FontStyle-Eigenschaft programmgesteuert festgelegt wird.

FlowDocument flowDoc = new FlowDocument(new Paragraph(new Run("A bit of text content...")));
// Set the desired column gap to 10 device independend pixels.
flowDoc.FontFamily = new FontFamily("Century Gothic");
flowDoc.FontSize = 12.0;
flowDoc.FontStretch = FontStretches.UltraExpanded;
flowDoc.FontStyle = FontStyles.Italic;
flowDoc.FontWeight = FontWeights.UltraBold;
Dim flowDoc As New FlowDocument(New Paragraph(New Run("A bit of text content...")))
' Set the desired column gap to 10 device independend pixels.
flowDoc.FontFamily = New FontFamily("Century Gothic")
flowDoc.FontSize = 12.0
flowDoc.FontStretch = FontStretches.UltraExpanded
flowDoc.FontStyle = FontStyles.Italic
flowDoc.FontWeight = FontWeights.UltraBold

Hinweise

Alle FontStyle Einstellungen für untergeordnete Elemente setzen diese Einstellung auf oberster Ebene außer Kraft.

Informationen zur Abhängigkeitseigenschaft

Element Wert
Bezeichnerfeld FontStyleProperty
Auf Metadateneigenschaften festgelegt true AffectsMeasure, AffectsRenderInherits

Gilt für: