Insert a line break into textbox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Dear all,

Is it possible to insert a line break into a textbox that the 'Multiline'
has been set to True? I used "\n" in C# but it doesn't work.

Thanks for any help,

Tedmond
 
Dear all,

Is it possible to insert a line break into a textbox that the 'Multiline'
has been set to True? I used "\n" in C# but it doesn't work.

It should be - but isn't \n Unix?

Use Environment.Newline which I *think* will give you \n\r.
 
"\r\n" in the string will cause a linebreeak. This only works in code
however because if you do it in design-time the editor causes the '\'
characters to be escaped and they look like "hello\r\nWorld" in the runtime.

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

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

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

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 
Jeff Gaines said:
It should be - but isn't \n Unix?

Use Environment.Newline which I *think* will give you \n\r.

.... on Windows-based systems.
 
Actually, "\r\n" (on Windows systems)

--
HTH,

Kevin Spencer
Chicken Salad Surgeon
Microsoft MVP
 
Back
Top