How to show hyperlink inside AboutBox description field

I want to put a link in my application description field about the field that will direct users to the wiki page for more help. I can't figure out how to make the address appear as a link.

I am setting the description via the build info properties.

enter image description here

+3


source to share


1 answer


Here you can use the WinForms control to achieve the desired result: LinkLabel

.

Just add it to your AboutBox layout and double click it. A handler will be created for the LinkClicked event and then you can use Process.Start

to open your website url.

Example of LinkLabel in an AboutBox



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());
}

      

In my case, I saved the URL as an application resource. And I showed this separately from the assembly description.

If you want the link to appear inside the assembly description, this is pretty tricky ...

+4


source







All Articles