Search code examples
vb.nettooltip

Tooltip display in VB.NET


Using either the Designer properties or by programming it directly, I cannot seem to get a tool tip to display the way I thought I should be able when I hover over the control.

For instance, although I can display the text I want, no matter what I set as the AutoPopDelay (I want 30 seconds) or as the background color (I want a Yellow), the tool tip always comes up for the default 5 seconds on a gray background only.

Below is the sub that I programmed. What am I missing?:

Private Sub lblUploadFileTypeHelp_MouseHover(sender As Object, e As EventArgs) Handles lblUploadFileTypeHelp.MouseHover

    ToolTip1.OwnerDraw = True
    ToolTip1.IsBalloon = True
    ToolTip1.BackColor = Color.LemonChiffon
    ToolTip1.AutoPopDelay = 30000
    ToolTip1.Show("Sample text to display", lblUploadFileTypeHelp)

End Sub

Solution

  • IsBalloon is being taken into consideration before OwnerDraw. You would need to handle your own drawing to get a custom display. Have a look at the MSDN code sample MSDN Tooltip