textbox newline

  • Thread starter Thread starter john bailo
  • Start date Start date
J

john bailo

How do create a new line in a text box.

If I put \n in my string, and set .Text to the
value of the string, a carriage return character is displayed literally,
but it doesn't actually start on a new line in the textbox.
 
john bailo said:
How do create a new line in a text box.
If I put \n in my string, and set .Text to the
value of the string, a carriage return character is displayed literally,
but it doesn't actually start on a new line in the textbox.

Use \r\n.

-- Alan
 
Where can you look up all those \r\n thingy me gigs in the in the
documentation?
 
Bob Powell said:
If you do it programatically "Something\r\nWicked" it will show up as a
newline but not if you go through the designer. Also, ensure that you don't
have the @ (literal string) in front of it.

Bob Powell [MVP]
C#, System.Drawing

Thanks -- I left off the \r and just put in the \n

Now it works !!!

Thanks Bob.
 
all those \r\n thingy me gigs

Not many of them...

\\ literal backslash
\n literal newline
\r literal carriage return
\t literal horizontal tab
\v literal vertical tab
\" literal double-quote

\v is recognized but you can't use it in a text box.

--
Bob Powell [MVP]
C#, System.Drawing

September's edition of Well Formed is now available.
http://www.bobpowell.net/currentissue.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm
 
Back
Top