C#.NET: How to create a new line in textbox control?

I was doing some programming today in Visual Studio 2008 and came across a problem on how to create a new line in textbox control. So, how?

"\r\n"

Sample code:

tb.Text = "Hello\r\nWorld"

Output:

Hello

World


 

That's it!

Comments

  1. Wow, I never thought how easy it was. Thanks!

    ReplyDelete

Post a Comment

Popular posts from this blog

Creating tray application and popup context menu in Windows

How to implement mouse drag using wxWidgets

Visual Studio 2008 MFC: How to embed a dialog to a dialog