DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

C#: Inserting New Line In Multiline Textbox

  • submit to reddit
        // Ref:
// Make sure MultiLine property is true and use "\r\n"

  TextBox1.Text = "First line\r\nSecond line";


Boyan Kostadinov replied on Wed, 2008/02/20 - 1:33pm

A better choice would be to use Environment.NewLine instead of "\r\n"