Condividi tramite


Paragraph.TextDecorations Proprietà

Definizione

Ottiene o imposta un oggetto TextDecorationCollection che contiene decorazioni di testo da applicare a questo elemento.

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

Valore della proprietà

Insieme TextDecorationCollection che contiene decorazioni di testo da applicare a questo elemento. Un valore indica null che non verrà applicata alcuna decorazione di testo. Il valore predefinito è null.

Esempio

Nell'esempio seguente viene illustrato come impostare la proprietà TextDecorations di un 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

La figura seguente mostra come viene eseguito il rendering di questo esempio.

Screenshot: testo con effetto barrato predefinito

Le figure seguenti mostrano come vengono visualizzate rispettivamente le decorazioni Overline, Baselinee Underline.

Screenshot: Screenshot di TextDecorator overline

Screenshot: effetto baseline predefinito sul testo

Screenshot: Testo con effetto sottolineatura predefinito Screenshot

Commenti

Un TextDecoration oggetto è un ornamento visivo che è possibile aggiungere al testo. Esistono quattro tipi di decorazioni di testo: sottolineatura, linea di base, barrato e overline. Per altre informazioni sulle decorazioni di testo, vedere Procedura: Creare una decorazione di testo.

Informazioni sulle proprietà di dipendenza

Elemento Valore
Campo Identificatore TextDecorationsProperty
Proprietà dei metadati impostate su true AffectsRender

Si applica a