<Style x:Key="hyberlinkEffect" TargetType="{x:Type Hyperlink}">

<Setter Property="Foreground" Value="#3D6490"></Setter>

<Setter Property ="TextBlock.TextDecorations" Value ="{x:Null}" />

<Style.Triggers >

<Trigger Property ="IsMouseOver" Value ="True" >

<Setter Property ="Foreground" Value ="#658BAF" />

<!-- 在鼠标悬停时显示下划线 -->

<Setter Property ="TextBlock.TextDecorations" >

<Setter.Value >

<TextDecorationCollection >

<TextDecoration Location ="Underline" />

</TextDecorationCollection >

</Setter.Value >

</Setter >

</Trigger >

</Style.Triggers >

</Style>



以上的样式是textblock的超链接没有下划线   鼠标移动到上面有下划线  ,初始颜色  鼠标移动上的颜色你自己修改

 

用法:

<TextBlock x:Name="txtForget" Grid.Row="2" Grid.Column="4" VerticalAlignment="Center" Margin="5,4,0,2">
<Hyperlink NavigateUri="http://www.joyeon.com/" Click="Hyperlink_Click" ToolTip="几分钟帮你搞定" Style="{StaticResource hyberlinkEffect}" >忘记密码?</Hyperlink>

我只提供一个思路,如果你对这跟导线而扩展了它的导线长度,还希望你能够无私分享,如果你有更好的思路,希望能互相学习,谢谢了

相关文章:

  • 2021-10-04
  • 2022-02-23
  • 2021-05-23
  • 2021-09-16
  • 2022-12-23
  • 2021-06-14
  • 2021-07-29
  • 2022-02-16
猜你喜欢
  • 2022-01-15
  • 2022-01-02
  • 2021-12-19
  • 2021-10-05
  • 2022-01-17
  • 2021-10-14
  • 2021-06-04
相关资源
相似解决方案