Using Multiline on a text box

  • Thread starter Thread starter Brian L
  • Start date Start date
* "Brian L said:
How do I fill a text box with multiply lines of text from
code?

\\\
Me.TextBox1.Text = _
"Hello" & ControlChars.NewLine & _
"World"
///
 
Brian said:
How do I fill a text box with multiply lines of text from
code?

Hi Brian,

TextBox1.MultiLine = True
TextBox1.Text = "Test" & Environment.NewLine & "Test2"
or
TextBox1.Text = "Test" & vbNewLine & "Test2"
or
TextBox1.Text = "Test" & vbCrLf & "Test2"

Cheers

Arne Janning
 
Hi Herfried,

A nice sample, much better than the samples Arne gave.

Although the VbNewLine sample from Arne is much easier to remember, is it in
my opinion in your way much easier to convert VB.net programs in future to
C#.
\\\
Me.TextBox1.Text = _
"Hello" & ControlChars.NewLine & _
"World"
///

Cor
 
Hi Cor,

* "Cor Ligthert said:
A nice sample, much better than the samples Arne gave.

Although the VbNewLine sample from Arne is much easier to remember, is it in
my opinion in your way much easier to convert VB.net programs in future to
C#.

It's actually /not/ easier, because 'ControlChars' is part of the VB.NET
Runtime Library. I think you are referring to 'Encironment.NewLine'
which is part of the BCL.
 
Hi Herfried,

You are absolutly right, however you know why the message was written and to
add something to that, is environment in the German language encironment?

(I know I make them much more than you, you see it with this message)

However I could not resist because that funktion.

:-)

(Hi Arne, it was not actualy true what I was writting, however Herfried is
seldom using code from the single dotNet namespace when there is a
Microsoft.VisualBasic equivalent and therfore I wrote this, however again as
usual when I do this to a regular, without good looking to it).

Cor
 
Back
Top