Archive

Archive for February 1st, 2008

Visual C# Note: How to Add a New Line in C# Textbox

February 1st, 2008 No comments

If you’re building a Windows Form Application, for example with C# or Visual Basic, then you may need to add a new line character, for example in a multiline TextBox. You do this using Enviroment.NewLine to insert the line break as follows:

textBox1.Text="First Line" + Environment.NewLine + "Second Line";

Categories: C# Tags: