Moh*_*eeq 3 c# windows-phone-8
我在C#中开发了一个hyperlinkButton.超链接中的下划线让我感到恼火.我不知道如何删除它.帮我删除下划线,我需要在C#中回答.[这是WP8应用程序]
HyperlinkButton hyperlinkButton = new HyperlinkButton()
{
Content = "Click me",
HorizontalAlignment = HorizontalAlignment.Left,
NavigateUri = new Uri("http://my-link-com", UriKind.Absolute)
};
Run Code Online (Sandbox Code Playgroud)
您可以直接设置属性,也可以使用样式:
<Style TargetType="{x:Type Hyperlink}">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="DarkSlateBlue" />
</Trigger>
</Style.Triggers>
<Setter Property="Foreground" Value="SteelBlue" />
<Setter Property="TextBlock.TextDecorations" Value="{x:Null}" />
</Style>
Run Code Online (Sandbox Code Playgroud)