-
C# 教程之C# winform 中linklabel控件
- 2016-01-19 20:28 来源:未知
C# winform 中linklabel控件 怎么一点这个控件就可以打开网页,怎么写代码
浏览次数:95次悬赏分:0 | 解决时间:2011-5-20 09:45 |
最佳答案
private void linkLabel1_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
{
try
{
VisitLink();
}
catch (Exception ex )
{
MessageBox.Show("Unable to open link that was clicked.");
}
}
private void VisitLink()
{
// Change the color of the link text by setting LinkVisited
// to true.
linkLabel1.LinkVisited = true;
//Call the Process.Start method to open the default browser
//with a URL:
System.Diagnostics.Process.Start("//www.microsoft.com");
}
浏览次数:95次悬赏分:0 | 解决时间:2011-5-20 09:45 |
最佳答案
private void linkLabel1_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
{
try
{
VisitLink();
}
catch (Exception ex )
{
MessageBox.Show("Unable to open link that was clicked.");
}
}
private void VisitLink()
{
// Change the color of the link text by setting LinkVisited
// to true.
linkLabel1.LinkVisited = true;
//Call the Process.Start method to open the default browser
//with a URL:
System.Diagnostics.Process.Start("//www.microsoft.com");
}