Resolved UserControl tooltip message not appearing

pizzaboy

Well-known member
Joined
Jan 5, 2008
Messages
57
Programming Experience
1-3
Why does the tooltip info not appear for my custom UserControls?

OK, my UserControl consists of quite a few controls and the ToolTip control does allow me to assign a string to the UserControl, but... the ToolTip message never appears?

I've tested the ToolTip against a standard Button control so it definitely works.

Any workarounds?

Any help would be greatly appreciated.

Thanks.
 
Last edited:
When you assign Tooltip text for a control it will only display when you hover the control area, and not over child controls, these controls needs Tooltip text set for themselves. Apart from that Tooltips work fine for user controls (and their child controls).
 
Thanks for the help.

I'm solving the issue by placing this code in my UserControls:

Public Sub ToolTip(ByVal tt As ToolTip, ByVal message As String)
ApplyToolTipToChildControls(Me, tt, message)
End Sub
Private Sub ApplyToolTipToChildControls(ByVal parent As Control, ByVal tt As ToolTip, ByVal message As String)
For Each Control In parent.Controls
tt.SetToolTip(Control, message)
If parent.HasChildren Then
ApplyToolTipToChildControls(Control, tt, message)
End If
Next
End Sub
 
Back
Top