How to Indicate new line in TextBox

the_one2003a

Member
Joined
May 15, 2005
Messages
10
Programming Experience
Beginner
Hi

I am new to vb .net

I created a textbox and I want to represent every string of data in a new line but I don't know how.

In many languages (c,c++,php,..) '\n' would indicate the new line in a string but how can I do this in vb .net

Thanks alot
 

jmcilhinney

VB.NET Forum Moderator
Staff member
Joined
Aug 17, 2004
Messages
14,376
Location
Sydney, Australia
Programming Experience
10+
There are a few ways of adding a new line to a String but the preferred way in .NET is to use ControlChars.NewLine, e.g.:
VB.NET:
Dim multiLineString As String = "Line 1" & ControlChars.NewLine & "Line 2"
 
Top Bottom