Multiline Tooltip in Listbox Cell

Consider the following Xojo code:

Var Content as String = “Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor”_
+“incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco” _
+“laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit” _
+“esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa” _
+“qui officia deserunt mollit anim id est laborum.”

TextField1.text = Content
TextField1.Tooltip = Content

Listbox1.CellTooltipAt(0,0) = Content

When you run the code and hold your mouse cursor over the TextField, Xojo automatically and elegantly configures the tooltip into a multiline box.

Conversely, when you hold your mouse cursor over the Listbox Cell, the tooltip runs off the edge of the computer screen in a single line!

Is there a way to configure the tooltip in a Listbox Cell to behave with a multiline format similar to the tooltip in the Textfield?

Xojo version?
Windows? Mac? Linux?

Xojo Version 2021 Release 1.1

Windows 10, Xojo Desktop Project

You can open a bug report. Mac is multiline.

With so large text ?

Do you think at building yours ?

This code creates a multiline tooltip for a Listbox Cell in Windows:
Var result As String
Var iLineLength As Integer
Var iSearchStart As Integer
Var iLineStart as Integer
Var idxSpaceFound As Integer
Var source as String = Content

// Loop through the string to find words by searching for spaces
idxSpaceFound = source.IndexOf(iSearchStart, " ")

iLineLength = idxSpaceFound - iLineStart // Determine current length of line

if iLineLength >= 70 then
result = result + source.Middle(iLineStart, iLineLength) + EndOfLine
iLineStart = idxSpaceFound + 1
end if

if idxSpaceFound < 0 then
result = result + source.Right(source.Length - iLineStart)
end if

iSearchStart = idxSpaceFound + 1 // Get next word

Loop Until idxSpaceFound = -1

Listbox1.CellTooltipAt(0,0) = result

Well, the problem is that what you are seeing IS NOT a tooltip. Is just a horrendous custom window that xojo uses instead of the real tooltips.

Personally I find ToolTips annoying (though that does not excuse Xojo) as they are slow, tend to obscure information that I want or even need to see, and usually disappear before I have read it all. So I prefer an InfoLabel or InfoCanvas at the bottom of the window - the info appears and disappears instantly as the mouse enters or exits a control, stays for as long as the user likes, and isn’t obscuring anything.


What you wrote Markus may be the reason why I also do that !

The idea of an InfoLabel is intriguing to me. Is it similar to the info at the bottom of the Xojo IDE when you hold your mouse cursor over a method name?

Yes - and VERY easy to implement. If you have xDev my article about a simple hint system is in iissue 13.6. You can download the source code project at

1 Like

Many users actually hate the “inmediate” changes for being an eyesore in the window each time you move the cursor.

Tool tips DONT dissapear if the user dont move the cursor.
The “slowness” is a standard to not nagg the user allways, just when they really need to see

And the design must be made fot the actual users, not only the developper taste. Otherwise will be like the Xojo “we know best” :rofl:

Got a source for that? Or is that just a personal opinion?

I do actuall focus groups for the GUI design with the user in front of GUI choices. Tooltips and other help sources are always part of the study.

So your source is yourself? Well, color me unimpressed.

From someone who does focus groups for GUI design I would have expected some more professional source material, like a link to relevant studies as this is your area of expertise - unless I misunderstood what you said and you are “just” the help handing out the questionnaires (and no offence to the helpers - I love Darcy!). Surely you are familiar with the relevant published studies?

It’s also puzzling that you do not know that the ToolTip does indeed disappear after a short delay, whether you move your mouse or not (at least on Macs, can’t test on Windows as my blasted PC has a memory problem on boot). I would have expected experts to have detailed knowledge of the user interface they are investigating, but maybe you focus on Windows only? Or Linux?

Importantly it is also about HOW you implement it - you can be as intrusive as you want, but the best help is one which is there without being intrusive. It is very easy to move a “focus group” into the desired direction by giving them the choice between a well implemented ToolTip and a badly implemented InfoLabel - or the other way round. After all, “focus groups” are about opinions that are easily influenced and not hard Science.

I do not see many complaints about Xojo using a label (or canvas?) at the bottom of the code editor to show changing information all the time, or from any of my users.

In any case I provide the option to turn the information display off, so anyone who knows his way around any of my apps can disable it with a click of the mouse in Preferences.