Freigeben über


FlowDocument.FontWeight Eigenschaft

Definition

Dient zum Abrufen oder Festlegen der Schriftstärke der obersten Ebene für die FlowDocument.

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

Eigenschaftswert

Ein Element der FontWeights Klasse, das die gewünschte Schriftbreite angibt. Der Standardwert wird durch den MessageFontWeight Wert bestimmt.

Beispiele

Das folgende Beispiel zeigt, wie das FontWeight 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 FontWeight-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 FontWeight Einstellungen für untergeordnete Elemente setzen diese Einstellung auf oberster Ebene außer Kraft.

Informationen zur Abhängigkeitseigenschaft

Element Wert
Bezeichnerfeld FontWeightProperty
Auf Metadateneigenschaften festgelegt true AffectsMeasure, AffectsRenderInherits

Gilt für: