參考
--
With Me.LinkLabel1
.AutoSize = True
.Text = "百度,谷歌,新浪"
.LinkBehavior = LinkBehavior.HoverUnderline
.LinkColor = Color.BlueViolet
.LinkArea = New Windows.Forms.LinkArea(0, 2)
.Links(0).LinkData = "http://www.baidu.com"
.Links.Add(3, 2, "http://www.google.com")
.Links.Add(6, 2, "欢迎使用新浪网")
End With
Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked
'System.Diagnostics.Process.Start(e.Link.LinkData.ToString)
Me.LinkLabel1.Links(Me.LinkLabel1.Links.IndexOf(e.Link)).Visited = True
If e.Link.LinkData.ToString <> Nothing And e.Link.LinkData.ToString.StartsWith("http") Then
System.Diagnostics.Process.Start(e.Link.LinkData.ToString)
Else
MessageBox.Show("你按下的是:" & e.Link.LinkData.ToString, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
End Sub
沒有留言:
張貼留言