WPF textblock加入超链接

<TextBlock Grid.Row="" Margin="75,0,0,0">
<Hyperlink Name="BlogHl" Click="BlogHl_Click" NavigateUri="http://www.cnblogs.com/ZXdeveloper/">http://www.cnblogs.com/ZXdeveloper/</Hyperlink>
</TextBlock>
        private void BlogHl_Click(object sender, RoutedEventArgs e)
{
System.Diagnostics.Process.Start("http://www.cnblogs.com/ZXdeveloper/");
}

WPF textblock加入超链接

-------更新于20160426

<TextBlock>
<Run>访问地址:</Run>
<Hyperlink NavigateUri="http://www.tax861.gov.cn" RequestNavigate="Hyperlink_RequestNavigate">http://www.tax861.gov.cn</Hyperlink>
</TextBlock>
 private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e)
{
Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri));
e.Handled = true;
}

WPF textblock加入超链接

上一篇:c# winform调用摄像头识别二维码


下一篇:web前端教程之javascript创建对象的方法