[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2267
  • Last Modified:

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). :)

Thanks!

valkyrie_nc
0
valkyrie_nc
Asked:
valkyrie_nc
1 Solution
 
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. :)

Thanks!

Valkyrie_nc
0
 
shanmaniCommented:
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
"http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.celltooltiptextneeded(VS.85).aspx"

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now