1. 程式人生 > >WPF HyperLink鏈接下劃線隱藏

WPF HyperLink鏈接下劃線隱藏

get wpf ons type value lock 動態 隱藏 兩種

兩種方法:

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>

當然也可以動態資源添加,或者單獨樣式引入等等。

WPF HyperLink鏈接下劃線隱藏