Bagikan melalui


Paragraph.TextDecorations Properti

Definisi

Mendapatkan atau mengatur TextDecorationCollection yang berisi dekorasi teks untuk diterapkan ke elemen ini.

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

Nilai Properti

Koleksi TextDecorationCollection yang berisi dekorasi teks untuk diterapkan ke elemen ini. Nilai null berarti tidak ada dekorasi teks yang akan diterapkan. Nilai defaultnya adalah null.

Contoh

Contoh berikut menunjukkan cara mengatur properti TextDecorations dari Paragraph.

<FlowDocument ColumnWidth="200">
  <Paragraph TextDecorations="Strikethrough">
    This text will render with the strikethrough effect.
  </Paragraph>
</FlowDocument>
Paragraph parx = new Paragraph(new Run("This text will render with the strikethrough effect."));
parx.TextDecorations = TextDecorations.Strikethrough;
Dim parx As New Paragraph(New Run("This text will render with the strikethrough effect."))
parx.TextDecorations = TextDecorations.Strikethrough

Gambar berikut menunjukkan bagaimana contoh ini ditampilkan.

Cuplikan layar: Teks dengan efek coretan default

Gambar berikut menunjukkan bagaimana dekorasi Garis Atas, Garis Dasar, dan Garis Bawah masing-masing dirender.

Cuplikan layar: Cuplikan layar Overline TextDecorator

Cuplikan layar: Efek garis besar default pada teks

Cuplikan layar: Teks dengan efek garis bawah default

Keterangan

Objek TextDecoration adalah ornamentasi visual yang dapat Anda tambahkan ke teks. Ada empat jenis dekorasi teks: garis bawah, garis besar, coretan, dan garis besar. Untuk informasi selengkapnya tentang dekorasi teks, lihat Cara: Membuat Dekorasi Teks.

Informasi Properti Dependensi

Item Nilai
Bidang pengidentifikasi TextDecorationsProperty
Properti metadata diatur ke true AffectsRender

Berlaku untuk