• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1361
  • Last Modified:

vb.net tooltip display width

in vb.net how do you set the display width for tool tips.

when i enter long descriptions they display as wide as my screen.
what can i do to limit the width and force the wrap.
this can't be that hard can it.

           Dim scToolTip As New ToolTip
            ' Set up the delays for the ToolTip.
            scToolTip.AutoPopDelay = 5000
            scToolTip.InitialDelay = 100
            scToolTip.ReshowDelay = 500
            scToolTip.ShowAlways = True
1 Solution
There is no way i can find of minimising the width, howevre if you find out at what point you reach your favoured width for the tooltip you could make it perform a line feed.

For example:-

            Dim scToolTip As New ToolTip
            ' Set up the delays for the ToolTip.
            With scToolTip
                   .AutoPopDelay = 5000
                   .InitialDelay = 100
                   .ReshowDelay = 500
                   .ShowAlways = True
                   .SetToolTip(me.Control, "This is the first Line" & Chr(10) & "And this is the second")
            End With

This would create a tooltip on the me.Control (whatever control you decide) saying:-

This is the first line
And this is the second

The Chr(10) is the ASCII character code for a line feed.
AutoeformsAuthor Commented:
didn't solve it but i inserted line feeds at the propler location and made the problem go away

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now