WPF HyperLink链接下划线隐藏

时间:2018-09-28 19:02:26   收藏:0   阅读:1369

两种方法:

1.在Grid标签内添加资源样式。

<Grid.Resources>
<Style TargetType="Hyperlink">
<Setter Property="TextBlock.TextDecorations" Value="{x:Null}"></Setter>
</Style>
</Grid.Resources>

2.在windows.resource里面添加样式。

<Window.Resources>
<Style TargetType="Hyperlink">
<Setter Property="TextBlock.TextDecorations" Value="{x:Null}"></Setter>
</Style>
</Window.Resources>

当然也可以动态资源添加,或者单独样式引入等等。

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!