Below is a code that stores all the textboxes data into a string variable and then the contents of that variable is assigned to the richtextbox. There are two buttons, one to send the textboxes data to the richtextbox and another to save it to a text file. I hope you find it useful.
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim tbox As String = ""
tbox &= TextBox1.Text & Environment.NewLine &
TextBox2.Text & Environment.NewLine &
TextBox3.Text & Environment.NewLine &
TextBox4.Text & Environment.NewLine &
TextBox5.Text
RichTextBox1.Text = tbox
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
SaveMyFile()
End Sub
Public Sub SaveMyFile()
' Create a SaveFileDialog to request a path and file name to save to.
Dim saveFile1 As New SaveFileDialog()
' Initialize the SaveFileDialog to specify the RTF extension for the file.
saveFile1.DefaultExt = "*.txt"
saveFile1.Filter = "TXT Files|*.txt"
' Determine if the user selected a file name from the saveFileDialog.
If (saveFile1.ShowDialog() = System.Windows.Forms.DialogResult.OK) _
And (saveFile1.FileName.Length) > 0 Then
' Save the contents of the RichTextBox into the file.
RichTextBox1.SaveFile(saveFile1.FileName,
RichTextBoxStreamType.PlainText)
End If
End Sub
End Class