• 0

[VB.NET] Making a New line in a textbox


Question

i need to make this box return a newline after something is added.

ie:

txtreview.text = "Customer Name:" & " " & txtcustomername.text & vbcrlf

vbcrlf used to be the command in VB6 to create a new line...but what is it in .NET?

Link to comment
Share on other sites

10 answers to this question

Recommended Posts

  • 0
vbcrlf works in vs 2003 for me.

there's also the char(20) i think.. :unsure: I dunno I remember using a char(x) for a messagebox... :unsure:

Link to comment
Share on other sites

  • 0
chr(10) + chr(13) :p

Or VbCrLf, or ControlChars.something (I don't remember) :p

i was close enough :p trial and error ;)

Link to comment
Share on other sites

  • 0

I think you need to reference the Microsoft.VisualBasic (was that it? I haven't used VB.NET in a while) assembly if you want to have 'vbCrLf' back. It should be referenced by default in VB.NET projects, but who knows.

Anyway, I find that it's a better programming practice to use a common .NET constant such as Environment.NewLine, because ControlChars and vbCrLf are Visual Basic exclusive.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.