I am trying to concatenate the output of various functions into a textbox, but it all comes up in one biiig line. How can I insert break lines in between the variables? I have something like this:
Me.TextBox.text = output1 + output2
And I would like to have something like this:
Me.TextBox.text = output1 + ENTER + output2
Any ideas?
Thanks!
Also use & to concat strings vb.net, + is legacy support
Environment.NewLine is usually the preferred method. It'll produce a carriage return & line feed for Windows systems and a line feed only for Unix systems...
http://msdn.microsoft.com/en-us/library/system.environment.newline.aspx
Also note that you can use vbCrLf from the Microsoft.VisualBasic namespace which will always return a carriage return and line feed together.
The
Environment.NewLine
read-only variable is what you want to use. There's alsovbCrLf
, but this is for legacy purposes and not environment-dependant.Try the following: