TextDecorationLocation 열거형

정의

TextDecoration 개체의 세로 위치를 지정합니다.

public enum class TextDecorationLocation
public enum TextDecorationLocation
type TextDecorationLocation = 
Public Enum TextDecorationLocation
상속
TextDecorationLocation

필드

Baseline 3

기준선의 세로 위치입니다.

OverLine 1

윗줄의 세로 위치입니다.

Strikethrough 2

취소선의 세로 위치입니다.

Underline 0

밑줄의 세로 위치입니다. 기본값입니다.

예제

다음 예제에서는 밑줄 텍스트 장식 만들고 펜에 대 한 단색 브러시를 사용 합니다.

// 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>

설명

텍스트 장식으로는 4 가지 형식을 사용할 수 있습니다: 기준, 윗줄, 취소선 및 밑줄. 다음 예제에서는 텍스트를 기준으로 텍스트 장식의 위치를 보여 줍니다.

텍스트 장식 위치의 다이어그램
텍스트 장식 종류

적용 대상