TextDecorationLocation TextDecorationLocation TextDecorationLocation TextDecorationLocation Enum

Definition

Gibt die vertikale Position eines TextDecoration-Objekts an.Specifies the vertical position of a TextDecoration object.

public enum class TextDecorationLocation
public enum TextDecorationLocation
type TextDecorationLocation = 
Public Enum TextDecorationLocation
Vererbung
TextDecorationLocationTextDecorationLocationTextDecorationLocationTextDecorationLocation

Felder

Baseline Baseline Baseline Baseline 3

Die vertikale Position einer Baseline.The vertical position of a baseline.

OverLine OverLine OverLine OverLine 1

Die vertikale Position einer Überstreichung.The vertical position of an overline.

Strikethrough Strikethrough Strikethrough Strikethrough 2

Die vertikale Position von durchgestrichenem Text.The vertical position of a strikethrough.

Underline Underline Underline Underline 0

Die vertikale Position einer Unterstreichung.The vertical position of an underline. Dies ist der Standardwert.This is the default value.

Beispiele

Im folgenden Beispiel erstellt eine Textdekoration Unterstreichung und Pinsel mit Volltonfarbe für den Stift verwendet.The following example creates an underline text decoration and uses a solid color brush for the pen.

// Use a Red pen for the underline text decoration.
private void SetRedUnderline()
{
    // Create an underline text decoration. Default is underline.
    TextDecoration myUnderline = new TextDecoration();

    // Create a solid color brush pen for the text decoration.
    myUnderline.Pen = new Pen(Brushes.Red, 1);
    myUnderline.PenThicknessUnit = TextDecorationUnit.FontRecommended;

    // Set the underline decoration to a TextDecorationCollection and add it to the text block.
    TextDecorationCollection myCollection = new TextDecorationCollection();
    myCollection.Add(myUnderline);
    TextBlock2.TextDecorations = myCollection;
}
' Use a Red pen for the underline text decoration.
Private Sub SetRedUnderline()
	' Create an underline text decoration. Default is underline.
	Dim myUnderline As New TextDecoration()

	' Create a solid color brush pen for the text decoration.
	myUnderline.Pen = New Pen(Brushes.Red, 1)
	myUnderline.PenThicknessUnit = TextDecorationUnit.FontRecommended

	' Set the underline decoration to a TextDecorationCollection and add it to the text block.
	Dim myCollection As New TextDecorationCollection()
	myCollection.Add(myUnderline)
	TextBlock2.TextDecorations = myCollection
End Sub
<!-- Use a Red pen for the underline text decoration -->
<TextBlock
  FontSize="36" >
  jumps over
  <TextBlock.TextDecorations>
    <TextDecorationCollection>
      <TextDecoration 
        PenThicknessUnit="FontRecommended">
        <TextDecoration.Pen>
          <Pen Brush="Red" Thickness="1" />
        </TextDecoration.Pen>
      </TextDecoration>
    </TextDecorationCollection>
  </TextBlock.TextDecorations>
</TextBlock>

Hinweise

Textdekorationen sind in vier Arten verfügbar: Baseline, überstrichen, durchgestrichen und unterstrichen.Text decorations are available in four types: baseline, overline, strikethrough, and underline. Das folgende Beispiel zeigt die Speicherorte der Textdekorationen relativ zum Text.The following example shows the locations of the text decorations relative to the text.

Diagramm der TextergänzungsstellenDiagram of text decoration locations
Text-Decoration-TypenText decoration types

Gilt für: