Språk

TextDecoration.Location Egenskap

Definition

Hämtar eller anger den lodräta plats där textdekorationen ritas.

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

Egenskapsvärde

Den lodräta plats där textdekorationen ritas.

Exempel

I följande kodexempel skapas en genomstrykningstextdekoration med en pensel med en fast färg för pennan. Egenskapen Location är inställd på 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>

Kommentarer

I följande exempel visas platserna för textdekorationerna i förhållande till texten.

Diagram över platser för textdekoration Diagram Exempel på textdekorationstyper

Med PenOffset egenskapen kan du förskjuta textdekorationen från den angivna Location.

Information om beroendeegenskap

Objekt Value
Identifierarfält LocationProperty
Metadataegenskaper inställda på true Ingen

Gäller för