kfirba
kfirba

Reputation: 5441

How to set ToolTip's max width

I have a ToolTip which I want to assign maximum width to, and whenever the ToolTip reaches that width, it just jump a row down, just like label does.

How do I do that?

Upvotes: 1

Views: 2710

Answers (2)

Mash
Mash

Reputation: 1536

If you absolutely need to, you can set OwnerDraw = true and handle the Draw event yourself. An example can be found on this MSDN site.

Upvotes: 0

Hans Passant
Hans Passant

Reputation: 942518

That capability is not exposed in Winforms. A workaround is to insert line-breaks in the string to get multi-line tips. For example:

Public Class Form1
    Public Sub New()
        InitializeComponent()
        ToolTip1.SetToolTip(Me, "Hello" + vbCrLf + "world")
    End Sub
End Class

enter image description here

Upvotes: 2

Related Questions