using System;
using System.Drawing;
using System.Windows.Forms;
public class LinkLabelAddLink : Form {
LinkLabel lnkLA = new LinkLabel();
public LinkLabelAddLink(){
Size = new Size(300,250);
lnkLA.Parent = this;
lnkLA.Text = "Java2s.com";
lnkLA.Location = new Point(0,25);
lnkLA.AutoSize = true;
lnkLA.BorderStyle = BorderStyle.None;
lnkLA.Links.Add(0,7,"www.java2s.com");
lnkLA.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(lnkLA_LinkClicked);
}
static void Main()
{
Application.Run(new LinkLabelAddLink());
}
private void lnkLA_LinkClicked(object sender,LinkLabelLinkClickedEventArgs e)
{
lnkLA.LinkVisited = true;
System.Diagnostics.Process.Start(e.Link.LinkData.ToString());
}
}