【WPF学习手记】WPF超链接使用

xaml里添加超链接控件Hyperlink:

  • 后台代码
private void Hyperlink_Click(object sender, RoutedEventArgs e)
{
    Hyperlink link = sender as Hyperlink;
    Process.Start(new ProcessStartInfo(link.NavigateUri.AbsoluteUri));
    //Process.Start(((Hyperlink)sender).NavigateUri.ToString());
}

private void HLink_MouseMove(object sender, MouseEventArgs e)
{
    HLink.Foreground = new SolidColorBrush(Colors.Black);
}

private void HLink_MouseLeave(object sender, MouseEventArgs e)
{
    HLink.Foreground = new SolidColorBrush(Color.FromArgb(0xFF, 0xEA, 0xE5, 0xE3));
}

 

你可能感兴趣的:(WPF学习手记)