Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles Button1.Click
SaveTextBoxText("YourFileName")
End Sub
Private Sub SaveTextBoxText(ByVal filename As String)
Dim w As New System.IO.StreamWriter(filename, False)
w.WriteLine(TextBox1.Text)
w.WriteLine(TextBox2.Text)
w.WriteLine(TextBox3.Text)
w.WriteLine(TextBox4.Text)
'etc...
w.Close()
End Sub
If you have a lot of TextBoxes you could also do;
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles Button1.Click
SaveTextBoxText("YourFileName")
End Sub
Private Sub SaveTextBoxText(ByVal filename As String)
Dim w As New System.IO.StreamWriter(filename, False)
For Each ctl As Control In Me.Controls
If ctl.GetType.ToString = "System.Windows.Forms.TextBox" Then
w.WriteLine("TextBox " & ctl.Name & " has text " & ctl.Text)
End If
Next
w.Close()
End Sub
But beware that the order the textboxes are written may change if you rename them.