469,625 Members | 1,591 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,625 developers. It's quick & easy.

display "\t" in tooltip in .Net framework

BC
Hi
I am trying to display the formated text, a table like, in the tooptip in C#.
Something like this:
Apple 4
lime 100

I put "\t" after the "Apple".
Somehow the tab "\t" won't show in the tooltip.
When the tooltip shown, it displayed "Apple" only in the tooltip.

But I tried to display the exact text in a MessageBox, it works fine.

Anyone knows how to show the "\t" in the tooptip?

Thanks
BC
Nov 16 '05 #1
3 1632
Jay
try this
toolTip1.SetToolTip(this.btnBind, string.Format("{0} \t {1}", var1,var 2));

Jay

"BC" <bc*****@yahoo.com> wrote in message
news:9b**************************@posting.google.c om...
Hi
I am trying to display the formated text, a table like, in the tooptip in
C#.
Something like this:
Apple 4
lime 100

I put "\t" after the "Apple".
Somehow the tab "\t" won't show in the tooltip.
When the tooltip shown, it displayed "Apple" only in the tooltip.

But I tried to display the exact text in a MessageBox, it works fine.

Anyone knows how to show the "\t" in the tooptip?

Thanks
BC

Nov 16 '05 #2
B C

That was how I coded. I think there is bug in tooltip class in .Net
Framework. The "\r\n" works fine in the tooltip text. But "\t" won't
work. Any text after the "\t" won't be shown in the Tooltip text. But
if I did:

toolTip1.SetToolTip(this.btnBind, string.Format("{0} \t {1}", var1,var
2));
string str = toolTip1.GetToolTip(this.btnBind);

the str had correct text set in the SetToolTip text.

The interesting thing is the same string with "\t" showed in the
MessageBox correctly.

BC

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #3
Hello BC,

Did you have any luck in finding a way to get tabs to work in tooltips?
It would also be nice to add my own formatting like bold and setting
the backcolor to white (not yellow).
pretty limiting the way it is now...

-dave

Nov 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by SHYAM SUNDAR E G | last post: by
5 posts views Thread by Vinny Vin | last post: by
5 posts views Thread by Sue | last post: by
reply views Thread by =?Utf-8?B?TWlrZQ==?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.