İngilizce dilinde oku

Aracılığıyla paylaş


TextDecorationLocation Sabit listesi

Tanım

Nesnenin TextDecoration dikey konumunu belirtir.

C#
public enum TextDecorationLocation
Devralma
TextDecorationLocation

Alanlar

Name Değer Description
Baseline 3

Taban çizgisinin dikey konumu.

OverLine 1

Üst çizginin dikey konumu.

Strikethrough 2

Üstü çizili bir dikey konum.

Underline 0

Alt çizginin dikey konumu. Varsayılan değer budur.

Örnekler

Aşağıdaki örnek, bir alt çizgi metin dekorasyonu oluşturur ve kalem için düz bir renk fırçası kullanır.

C#
// 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;
}
XAML
<!-- 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>

Açıklamalar

Metin süslemeleri dört türde kullanılabilir: taban çizgisi, üst çizgi, üstü çizili ve altı çizili. Aşağıdaki örnekte metin süslemelerinin metne göre konumları gösterilmektedir.

Metin dekorasyon konumlarının diyagramı
Metin dekorasyon türleri

Şunlara uygulanır

Ürün Sürümler
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9