TextDecoration.Location 屬性

定義

取得或設定繪製文字裝飾的垂直位置。

public:
 property System::Windows::TextDecorationLocation Location { System::Windows::TextDecorationLocation get(); void set(System::Windows::TextDecorationLocation value); };
public System.Windows.TextDecorationLocation Location { get; set; }
member this.Location : System.Windows.TextDecorationLocation with get, set
Public Property Location As TextDecorationLocation

屬性值

TextDecorationLocation

繪製文字裝飾的垂直位置。

範例

在下列程式碼範例中,會使用畫筆的純色筆刷來建立刪除線文字裝飾。 Location 屬性會設定為 Strikethrough

// Use the default font values for the strikethrough text decoration.
private void SetDefaultStrikethrough()
{
    // Set the underline decoration directly to the text block.
    TextBlock1.TextDecorations = TextDecorations.Strikethrough;
}
' Use the default font values for the strikethrough text decoration.
Private Sub SetDefaultStrikethrough()
    ' Set the underline decoration directly to the text block.
    TextBlock1.TextDecorations = TextDecorations.Strikethrough
End Sub
<!-- Use the default font values for the strikethrough text decoration. -->
<TextBlock
  TextDecorations="Strikethrough"
  FontSize="36" >
  The quick red fox
</TextBlock>

備註

下列範例顯示文字裝飾相對於文字的位置。

文字裝飾位置的圖表
文字裝飾類型的範例

屬性 PenOffset 可讓您從指定的 Location 位移文字裝飾。

相依性屬性資訊

識別碼欄位 LocationProperty
中繼資料屬性設定為 true

適用於