如何在AboutBox的描述字段中显示超链接

Chr*_*con 5 c# winforms visual-studio-2013

我想在我的应用程序的描述字段中放置一个关于框的链接,该链接将用户引导到维基页面以获得更多帮助.我无法弄清楚如何使地址显示为链接.

我通过程序集信息属性设置描述.

在此输入图像描述

alm*_*ulo 6

你可以使用WinForms控件来实现你想要的东西:LinkLabel.

只需在AboutBox布局中添加一个,然后双击它.将创建其LinkClicked事件的处理程序,然后您可以使用Process.Start它打开您网站的URL.

AboutBox中LinkLabel的示例

public AboutBox1()
{
    InitializeComponent();
    this.Text = String.Format("About {0}", AssemblyTitle);
    this.labelProductName.Text = AssemblyProduct;
    this.labelVersion.Text = String.Format("Version {0}", AssemblyVersion);
    this.labelCopyright.Text = AssemblyCopyright;
    this.labelCompanyName.Text = AssemblyCompany;
    this.textBoxDescription.Text = AssemblyDescription;
    this.Link.Text = "Visit our website!";
    this.Link.Tag = WpfApplication2.Properties.Resources.website;
}

private void Link_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
    System.Diagnostics.Process.Start((sender as LinkLabel).Tag.ToString());
}
Run Code Online (Sandbox Code Playgroud)

就我而言,我已将URL保存为应用程序资源.我已经将其与大会说明分开展示了.

如果您希望链接显示在"装配描述"中,则会更加复杂......