Inline.TextDecorations Propriété

Définition

Obtient une TextDecorationCollection qui contient des ornements de texte à appliquer à l'é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é

TextDecorationCollection

Collection TextDecorationCollection qui contient les ornements de texte à appliquer à l'élément.

La valeur par défaut est Null (aucune décoration de texte n’est appliquée).

Exemples

L’exemple suivant montre comment définir l’attribut TextDecorations d’un Inline élément (Run).

<FlowDocument ColumnWidth="200">
  <Paragraph>
    <Run TextDecorations="Strikethrough">
      This text will render with the strikethrough effect.
    </Run>
  </Paragraph>
</FlowDocument>

La figure suivante montre le rendu de cet exemple.

Capture d'écran : texte avec effet barré par défaut

Les illustrations suivantes montrent le rendu des décorations Overline, Baseline et Souligné , respectivement.

Capture d'écran : Overline TextDecorator

Capture d'écran : effet de la ligne de base par défaut sur le texte

Capture d'écran : texte avec effet souligné par défaut

L’exemple suivant montre comment définir la TextDecorations propriété par programmation.

Run run1 = new Run("This text will render with the strikethrough effect.");
run1.TextDecorations = TextDecorations.Strikethrough;
Dim run1 As New Run("This text will render with the strikethrough effect.")
run1.TextDecorations = TextDecorations.Strikethrough

Remarques

Un TextDecoration objet est un ornement visuel 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

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

S’applique à