-
Notifications
You must be signed in to change notification settings - Fork 19
/
WebLink.cs
54 lines (50 loc) · 1.31 KB
/
WebLink.cs
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace CDBurnerXP.Controls
{
public class WebLink : LinkLabel
{
private string m_Url = string.Empty;
public string Url
{
get
{
return m_Url;
}
set
{
m_Url = value;
}
}
protected override void OnLinkClicked(LinkLabelLinkClickedEventArgs e)
{
base.OnLinkClicked(e);
if (e.Button == MouseButtons.Left)
{
try
{
System.Diagnostics.Process.Start(m_Url);
}
catch (FileNotFoundException)
{
// occurs if browser cannot be started or shows a message before starting
}
catch (System.ComponentModel.Win32Exception)
{
// occurs if browser cannot be started or shows a message before starting
}
}
else
{
try
{
Clipboard.SetData(DataFormats.Text, m_Url);
}
catch (Exception) { }
}
}
}
}