TextDecorationLocation 열거형
.NET Framework 3.5
업데이트: 2007년 11월
TextDecoration 개체의 세로 위치를 지정합니다.
어셈블리: PresentationCore(PresentationCore.dll)
다음 예제에서는 밑줄 텍스트 장식을 만들고 단색 브러시를 펜으로 사용합니다.
// 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 --> <TextBlock FontSize="36" > jumped over <TextBlock.TextDecorations> <TextDecorationCollection> <TextDecoration PenThicknessUnit="FontRecommended"> <TextDecoration.Pen> <Pen Brush="Red" Thickness="1" /> </TextDecoration.Pen> </TextDecoration> </TextDecorationCollection> </TextBlock.TextDecorations> </TextBlock>
Windows Vista
.NET Framework 및 .NET Compact Framework에서 모든 플랫폼의 전체 버전을 지원하지는 않습니다. 지원되는 버전의 목록을 보려면 .NET Framework 시스템 요구 사항을 참조하십시오.
