For entering the text on multiple lines the
MultiLine
property of
TextBox
is to be set to
True
. When the
MultiLine
property is set to
True
, the
Lines
property of
TextBox
returns an
array of lines
entered in the
TextBox
. Using this property each line entered in the
TextBox
can be accessed and set in the
TextBoxes
of the
Form2
as shown below
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim form2 As New Form2
form2.TextBox1.Text = IF(TextBox1.Lines.Length >= 1,TextBox1.Lines(0),"")
form2.TextBox2.Text = IF(TextBox1.Lines.Length >= 2,TextBox1.Lines(1),"")
form2.TextBox3.Text = IF(TextBox1.Lines.Length >= 3,TextBox1.Lines(2),"")
form2.ShowDialog()
End Sub