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

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

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:
  1. No comments yet.
  1. No trackbacks yet.