一、简介
1、TextDecorations 属性值:
None:无
OverLine:上划线
Strikethrough:删除线/中划线
Baseline:基线
Underline:下划线
一、创建项目
<Window
x:Class="WpfApp.StudyTextDecoration.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Title="TextDecorations"
Width="400"
Height="300"
mc:Ignorable="d">
<Window.Resources>
<Style TargetType="TextBlock">
<Setter Property="Margin" Value="10" />
<Setter Property="FontSize" Value="20" />
</Style>
</Window.Resources>
<Grid>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="None" TextDecorations="None" />
<TextBlock Text="OverLine" TextDecorations="OverLine" />
<TextBlock Text="Strikethrough" TextDecorations="Strikethrough" />
<TextBlock Text="Baseline" TextDecorations="Baseline" />
<TextBlock Text="Underline" TextDecorations="Underline" />
</StackPanel>
</Grid>
</Window>