<TextBlock>
<Hyperlink Name="hc" Click="hc_Click" NavigateUri=" http://www.bing.com/"> Bing </Hyperlink>
</TextBlock>
private void hc_Click(object sender, RoutedEventArgs e){
System.Diagnostics.Process.Start("http://www.bing.com/");
}
或者 在后台赋值txtB.Text=‘ url ‘;
<TextBlock>
<Hyperlink Name="hc" Click="hc_Click" TextDecorations="None">
<TextBlock x:Name="txtB" Text="Bing"/>
</Hyperlink>
</TextBlock>
private void hc_Click(object sender, RoutedEventArgs e){
System.Diagnostics.Process.Start(url);
}
时间: 2024-10-09 01:17:59