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
CODE TO CREATE LABEL:
Dim tabLblPulp As New Label
tabLblPulp.Loca tion = New Point(14, 121)
tabLblPulp.Size = New Size(54, 13)
tabLblPulp.Name = tp.Text & "lblPulpwoo d"
tabLblPulp.Text = "Pulpwood"
tabLblPulp.Fore Color = Color.Blue
tabLblPulp.Visi ble = True
tabLblPulp.Font = New System.Drawing. Font("Microsoft
Sans Serif", 8.25!, System.Drawing. FontStyle.Under line,
System.Drawing. GraphicsUnit.Po int, CType(0, Byte))
tp.Controls.Add (tabLblPulp)
'code to call sub
AddHandler tabLblPulp.Clic k, AddressOf ToolTiper
Public Sub ToolTiper(ByVal sender As Object, ByVal e As EventArgs)
Dim ctrlName As String
ctrlName = DirectCast(send er, Control).Name()
Dim ToolTip2 As New ToolTip
Dim ctrl As Control
For Each ctrl In Form7.Controls
If ctrl.Name = ctrlName Then
ToolTip2.SetToo lTip(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
CODE TO CREATE LABEL:
Dim tabLblPulp As New Label
tabLblPulp.Loca tion = New Point(14, 121)
tabLblPulp.Size = New Size(54, 13)
tabLblPulp.Name = tp.Text & "lblPulpwoo d"
tabLblPulp.Text = "Pulpwood"
tabLblPulp.Fore Color = Color.Blue
tabLblPulp.Visi ble = True
tabLblPulp.Font = New System.Drawing. Font("Microsoft
Sans Serif", 8.25!, System.Drawing. FontStyle.Under line,
System.Drawing. GraphicsUnit.Po int, CType(0, Byte))
tp.Controls.Add (tabLblPulp)
'code to call sub
AddHandler tabLblPulp.Clic k, AddressOf ToolTiper
Public Sub ToolTiper(ByVal sender As Object, ByVal e As EventArgs)
Dim ctrlName As String
ctrlName = DirectCast(send er, Control).Name()
Dim ToolTip2 As New ToolTip
Dim ctrl As Control
For Each ctrl In Form7.Controls
If ctrl.Name = ctrlName Then
ToolTip2.SetToo lTip(ctrl, "Test")
End If
Next
End Sub
Comment