Bagikan melalui


FlowDocument.FontWeight Properti

Definisi

Mendapatkan atau mengatur bobot font tingkat atas untuk 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

Nilai Properti

Anggota FontWeights kelas yang menentukan bobot font yang diinginkan. Default ditentukan oleh MessageFontWeight nilai .

Contoh

Contoh berikut menunjukkan cara mengatur FontWeight atribut FlowDocument elemen.

<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>

Contoh berikut menunjukkan cara mengatur properti FontWeight secara terprogram.

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

Keterangan

Pengaturan apa pun FontWeight pada elemen turunan mengambil alih pengaturan tingkat atas ini.

Informasi Properti Dependensi

Item Nilai
Bidang pengidentifikasi FontWeightProperty
Properti metadata diatur ke true AffectsMeasure, , AffectsRenderInherits

Berlaku untuk