display "\t" in tooltip in .Net framework

  • Thread starter Thread starter BC
  • Start date Start date
B

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
 
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
 
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
 
Back
Top