473,320 Members | 2,158 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to CRLF in MessageBox

I would like to know how to put text over 2 (or several) lines in a messageBox

I tried MessageBox.Show("Text-1" + "\\r\\n" + "text-2"); but that doesn't work
Feb 20 '09 #1
3 26100
vekipeki
229 Expert 100+
Why the double backslash?

"\r\n" should work, but a better way would be to use Environment.NewLine.
Feb 20 '09 #2
When you say "\\r\\n" , it should print "\" instead of "\\". so they are treated as 4 characters not the two.

as said, Environment.NewLine is the best option to cope with this.
Feb 20 '09 #3
Curtis Rutland
3,256 Expert 2GB
Yes, the problem is your double backslashes.

A single backslash and the following character is an escape sequence. So when you do "\\r" what you are literally doing is escaping the second backslash, so the literal string result is: "\r" What you should be doing is "\r" which is interpreted as a carriage return.

However, I also agree with everyone else. Environment.NewLine is a handy way to avoid escape sequences.
Feb 20 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

12
by: eddie wang | last post by:
What is CRLF? Thanks. *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
4
by: McKirahan | last post by:
How would I use a regular expression to remove all trailing Carriage Returns and Line Feeds (%0D%0A) from a textarea's value? Thanks in advance. Also, are they any great references for learning...
5
by: McKirahan | last post by:
I'd like to use regular expressions to remove extraneous Carriage Return Line Feeds (CrLf) from a textarea before the form is submitted. I'd like to remove all trailing CrLf's and convert all...
3
by: Jon | last post by:
Hi... I'm getting stumped over the something that MUST be simple...basically, I'm trying to replace the characters 0D0A with a crlf, using Regex.Replace(). The problem is, the replaced string...
1
by: Jack Wright | last post by:
Dear All, In a multiline field if I enter the following way: Mangesh Anant Kodilkar There is a carriage return after each word. Now when I press save,it loses the CRLF characters. This is not...
2
by: Michael Persaud | last post by:
Hi All, Im trying to have a few strings presented in a LABEL. However the CRLF is not working. eg str = str1 + crlf + str2 + crlf + str3 label.text= str Do i need to declare the crlf as a...
2
by: Andrew | last post by:
Hello. I am working with very large files in my .NET project (1 million plus records). Some of these files do not have crlf's, which makes it very hard to read the file without a layout or record...
0
by: Tomas | last post by:
When I use a __doPostBack to submit a page to the server the last textbox on the page always contains a CRLF. I've used HttpRequest.SaveAs to dump the entire request (IIS 6) to disk and the body of...
8
by: kerberoz | last post by:
whats the equivalent following ControlChars.Lf, ControlChars.Cr, ControlChars.CrLf code in vb.net
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.