Public Class DuplicateLinkLabel
Dim myLinkLabel As New LinkLabel()
Public Sub New(ByVal parentForm As Form, ByVal positionXY As Drawing.Point)
With myLinkLabel
.Parent = parentForm
.Width = 100
.Height = 25
.Location = positionXY
.Text = "New Link Label"
.Tag = "http://www.example.com/"
.CreateControl()
End With
AddHandler myLinkLabel.Click, AddressOf LinkLabelClick
End Sub
Public Sub LinkLabelClick()
MsgBox("TO DO: Add code here to do whatever you want with the click function.", MsgBoxStyle.Information, "TO DO")
End Sub
End Class
Public newLinkLabel As New DuplicateLinkLabel([COLOR="blue"]{HOSTFORM}[/COLOR], [COLOR="red"]{LOCATION}[/COLOR])
Public Class DuplicateLinkLabel
Dim myLinkLabel As New LinkLabel()
Public Sub New(ByVal parentForm As Form, ByVal positionXY As Drawing.Point)
With myLinkLabel
.Parent = parentForm
.Width = 100
.Height = 25
.Location = positionXY
.Text = "New Link Label"
.Tag = "http://www.example.com/"
.CreateControl()
End With
AddHandler myLinkLabel.Click, AddressOf LinkLabelClick
End Sub
Public Sub LinkLabelClick()
MsgBox("TO DO: Add code here to do whatever you want with the click function.", MsgBoxStyle.Information, "TO DO")
End Sub
End Class
Imports System
Public Class Form1
[B] Public newLinkLabel As New DuplicateLinkLabel(Me, New Drawing.Point(25, 25))[/B]
Private Sub Form1_Load()
....