-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathLinkLabel.cs
More file actions
28 lines (24 loc) · 898 Bytes
/
LinkLabel.cs
File metadata and controls
28 lines (24 loc) · 898 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using System;
using System.Windows.Forms;
namespace Examples {
class MainForm : Form {
public static void Main() {
Application.EnableVisualStyles();
Application.Run(new MainForm());
}
public MainForm() {
Text = "LinkLabel example";
label1.Parent = this;
label1.Text = "Gammasoft present CSharp examples";
label1.AutoSize = true;
label1.Location = new System.Drawing.Point(10, 10);
label1.Links.Add(new LinkLabel.Link(0, 9, "https://gammasoft71.wixsite.com/gammasoft"));
label1.Links.Add(new LinkLabel.Link(18, 6, "https://gammasoft71.wixsite.com/gammasoft/csharp"));
label1.LinkClicked += delegate(object sender, LinkLabelLinkClickedEventArgs e) {
e.Link.Visited = true;
System.Diagnostics.Process.Start(e.Link.LinkData as string);
};
}
private LinkLabel label1 = new LinkLabel();
}
}