Line breaks inside a tooltip?

I have a web app in .Net 2.0 C#.  When it was in development on my local machine, I was able to display line breaks (using \n) in my tooltips.  Now, they're all one long line and show a fat pipe where the line break should be.

Anyone know a way I can get the tooltip to display correctly again?  I've looked at some javascript alternatives but haven't found anything I really like (and this isn't anything I want to spend lots of time on). :)


Who is Participating?
valkyrie_ncAuthor Commented:
Thanks for the link, Lem2802.  I've tried the "title" attribute, but I still get those fat pipes in place of a "\n".  When I do a view source, there are no line breaks or \n's in there; instead, it looks in View Source like the line breaks are already there.  I tried escaping the \, but then I get something like this:  "Accounting\n\nJohn Doe\nJane Doe\n."  

I tried the Dynamic Drive script before, and I guess that'll be my best bet.  Still can't figure out the "was working before but not now" deal. :)


string newLine = Environment.NewLine;
MyLable.ToolTip = string.Format("Accounting {0} John Doe", newLine);

This will work.

Reason for commenting closed item:
Came across this solution when searching for similar issue and found an answer in msdn, it will help for those like me.

msdn link

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.