Partager via


Paragraph.TextDecorations Propriété

Définition

Obtient ou définit un TextDecorationCollection qui contient des décorations de texte à appliquer à cet élément.

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

Valeur de propriété

Collection TextDecorationCollection qui contient des décorations de texte à appliquer à cet élément. Une valeur de signifie qu’aucune null décoration de texte n’est appliquée. La valeur par défaut est null.

Exemples

L’exemple suivant montre comment définir la TextDecorations propriété d’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 figure suivante montre comment cet exemple s’affiche.

Capture d’écran : Texte avec effet de frappe par défaut Capture

Les illustrations suivantes montrent comment les décorations Overline, Baseline et Soulignement sont affichées respectivement.

Capture d’écran : Overline TextDecorator Capture

Capture d’écran : Effet de base de référence par défaut sur le texte Capture d’écran

Capture d’écran : Texte avec effet de soulignement par défaut Capture d’écran

Remarques

Un TextDecoration objet est une ornementation visuelle que vous pouvez ajouter au texte. Il existe quatre types de décorations de texte : soulignement, ligne de base, barré et surligne. Pour plus d’informations sur les décorations de texte, consultez Guide pratique pour créer une décoration de texte.

Informations sur les propriétés de dépendance

Élément Valeur
Champ d’identificateur TextDecorationsProperty
Propriétés de métadonnées définies sur true AffectsRender

S’applique à