J
Joshua Ellul
Hi There,
I'm trying to create a link label dynmically. The problems I'm having is
the following:
1. The LinkLabel is created without the underline
2. The click event is not being raised...
Here's my code:
Dim newLink As New LinkLabel()
With newLink
pnlTitle.Controls.AddRange(New System.Windows.Forms.Control() {newLink})
..Left = 100
..Top = 100
..AutoSize = True
..LinkBehavior = LinkBehavior.AlwaysUnderline
..ActiveLinkColor = System.Drawing.Color.Red
..Font = FontConv.ConvertFromString("Verdana, 14.25pt")
..Text = Desc
AddHandler .Click, AddressOf Me.Links_LinkClicked
AddHandler .MouseMove, AddressOf Me.Links_MM
End With
and the subs:
Private Sub Links_LinkClicked(ByVal sender As Object, ByVal e As
System.EventArgs)
MessageBox.Show("Link Clicked")
End Sub
Any Ideas?
Josh
I'm trying to create a link label dynmically. The problems I'm having is
the following:
1. The LinkLabel is created without the underline
2. The click event is not being raised...
Here's my code:
Dim newLink As New LinkLabel()
With newLink
pnlTitle.Controls.AddRange(New System.Windows.Forms.Control() {newLink})
..Left = 100
..Top = 100
..AutoSize = True
..LinkBehavior = LinkBehavior.AlwaysUnderline
..ActiveLinkColor = System.Drawing.Color.Red
..Font = FontConv.ConvertFromString("Verdana, 14.25pt")
..Text = Desc
AddHandler .Click, AddressOf Me.Links_LinkClicked
AddHandler .MouseMove, AddressOf Me.Links_MM
End With
and the subs:
Private Sub Links_LinkClicked(ByVal sender As Object, ByVal e As
System.EventArgs)
MessageBox.Show("Link Clicked")
End Sub
Any Ideas?
Josh