Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show a hyperlink inside the description field of an AboutBox

I want to place a link inside the description field of my applications about box which will direct users to a wiki page for more help. I can't figure out how to make the address appear as a link.

I set the description through the assembly information properties.

enter image description here

like image 335
ChrisPBacon Avatar asked Jun 16 '15 14:06

ChrisPBacon


1 Answers

There's a WinForms control you can use to achieve what you want: the LinkLabel.

Simply add one to your AboutBox layout and double click it. A handler to its LinkClicked event will be created, and there you can then use Process.Start to open your website's 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've saved the URL as an application resource. And I've showed it separately from the Assembly Description.

If you want the link to appear inside the Assembly Description, it's quite a bit more complicated...

like image 80
almulo Avatar answered Sep 25 '22 22:09

almulo