T
The Mad Ape
Hi
I have code to programatically create a label. It works but when I try
to call a sub to create a tooltip it does not work. I do not get an
error so have no idea what it wrong. Please review my code and tell me
how to fix it.
Thanks
The Mad Ape
www.tatumba.com
CODE TO CREATE LABEL:
Dim tabLblPulp As New Label
tabLblPulp.Location = New Point(14, 121)
tabLblPulp.Size = New Size(54, 13)
tabLblPulp.Name = tp.Text & "lblPulpwood"
tabLblPulp.Text = "Pulpwood"
tabLblPulp.ForeColor = Color.Blue
tabLblPulp.Visible = True
tabLblPulp.Font = New System.Drawing.Font("Microsoft
Sans Serif", 8.25!, System.Drawing.FontStyle.Underline,
System.Drawing.GraphicsUnit.Point, CType(0, Byte))
tp.Controls.Add(tabLblPulp)
'code to call sub
AddHandler tabLblPulp.Click, AddressOf ToolTiper
Public Sub ToolTiper(ByVal sender As Object, ByVal e As EventArgs)
Dim ctrlName As String
ctrlName = DirectCast(sender, Control).Name()
Dim ToolTip2 As New ToolTip
Dim ctrl As Control
For Each ctrl In Form7.Controls
If ctrl.Name = ctrlName Then
ToolTip2.SetToolTip(ctrl, "Test")
End If
Next
End Sub
I have code to programatically create a label. It works but when I try
to call a sub to create a tooltip it does not work. I do not get an
error so have no idea what it wrong. Please review my code and tell me
how to fix it.
Thanks
The Mad Ape
www.tatumba.com
CODE TO CREATE LABEL:
Dim tabLblPulp As New Label
tabLblPulp.Location = New Point(14, 121)
tabLblPulp.Size = New Size(54, 13)
tabLblPulp.Name = tp.Text & "lblPulpwood"
tabLblPulp.Text = "Pulpwood"
tabLblPulp.ForeColor = Color.Blue
tabLblPulp.Visible = True
tabLblPulp.Font = New System.Drawing.Font("Microsoft
Sans Serif", 8.25!, System.Drawing.FontStyle.Underline,
System.Drawing.GraphicsUnit.Point, CType(0, Byte))
tp.Controls.Add(tabLblPulp)
'code to call sub
AddHandler tabLblPulp.Click, AddressOf ToolTiper
Public Sub ToolTiper(ByVal sender As Object, ByVal e As EventArgs)
Dim ctrlName As String
ctrlName = DirectCast(sender, Control).Name()
Dim ToolTip2 As New ToolTip
Dim ctrl As Control
For Each ctrl In Form7.Controls
If ctrl.Name = ctrlName Then
ToolTip2.SetToolTip(ctrl, "Test")
End If
Next
End Sub