wpf hyperlink 隱藏下劃線
阿新 • • 發佈:2018-12-29
<
Style
TargetType
="Hyperlink"
>
<
Setter
Property
="Foreground"
Value
="#209AC2"
/>
<!--
清除文字修飾(去掉下劃線)
-->
<
Setter
Property
="TextBlock.TextDecorations"
Value
="
{x:Null}
"
/>
<
Style.Triggers
>
<
Trigger
Property
="IsMouseOver"
Value
="True"
>
<
Setter
Property
="Foreground"
Value
="#F27D00"
/>
<!--
在滑鼠懸停時顯示下劃線
-->
<
Setter
Property
="TextBlock.TextDecorations"
>
<
Setter.Value
>
<
TextDecorationCollection
>
<
TextDecoration
Location
="Underline"
/>
</
TextDecorationCollection
>
</
Setter.Value
>
</
Setter
>
</
Trigger
>
</
Style.Triggers
>
</
Style
>