'Tab' character causing problem in tooltips

G

Guest

I'm trying to display formatted multi-line text in tooltips. It seems that
the newline character works fine whereas the 'tab' character is causing
problems and can't display properly.

More specifically, when I set the caption of a tooltip to something like
"Hello" + vbTab + "there", the tooltip display as "Hello" and the rest of the
string is truncated.

I've searched the web but haven't seen any solution to this. I've seen
people suggest using '\t' in C# to show tab spaces, and I guess it works in
that language (though I haven't tried it). But I'm working on a VB.NET
project now and hope I can do the same in this language.

Is there anything I can do to make the 'tab' shown in tooltips or it's
simply not supported in current version of VB.NET (2003)?

Btw, I've tried it with message boxes and the 'tab' works fine there.

Please help. Thanks.
 
H

Herfried K. Wagner [MVP]

Cesario said:
I'm trying to display formatted multi-line text in tooltips. It seems that
the newline character works fine whereas the 'tab' character is causing
problems and can't display properly.

More specifically, when I set the caption of a tooltip to something like
"Hello" + vbTab + "there", the tooltip display as "Hello" and the rest of
the
string is truncated.

Tabs are not supported as part of a tooltip. This limitation is independent
from the .NET programming language you are using.
 
G

Guest

Thanks Bernie, I've actually tried vbTab, Chr(9), and ControlChars.Tab. I
guess they map to the same thing...
 
G

Guest

Thanks Herfried. I've seen people talking about creating custom tooltips
using Windows API. And I saw the balloon tooltip implementation on
codeproject though I didn't look into its details. From the screenshots, it
still seems possible to format text in tooltips?

And what about those nice tooltips that pop up on some websites that contain
more than just text? They display pictures and animations as well. I don't
know how different they're from tooltips in desktop applications. Maybe the
way they're implemented only makes sense in web browsers? But browsers are
themselves running on desktops...Could you please shed some light on this?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top