Open A New Project, Locate The Dialog tab in the toolbox. Drag OpenFileDialog & SaveFileDialog OnTo The Form. Copy & Paste text Over all text in Form1.
vb. PLace 5 Text boxes on the form. Then PLace 2 Buttons on the Form
When you run the Program it should work as advertised.. if not repost any other questions.
Code:
Imports System.IO
Public Class Form1
Dim ires As Integer = 0
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
ires = InputBox("Save Which TextBox " & vbCrLf & " Enter A NUmber Between 1 and 6... 6 Being All Boxes", " Enter A Number 1-6")
If ires < 1 Or ires > 6 Then Exit Sub
If SaveFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
Dim myStream As New StreamWriter(SaveFileDialog1.FileName, True)
Select Case ResizeRedraw
Case 1
myStream.Write(TextBox1.Text)
Case 2
myStream.Write(TextBox2.Text)
Case 3
myStream.Write(TextBox3.Text)
Case 4
myStream.Write(TextBox4.Text)
Case 5
myStream.Write(TextBox5.Text)
Case 6
MsgBox(" Place a Do Loop Code Here To Loop 6 Times And Either Prompt 5 times FOr a Filename Or INcerment File Name For Each TextBox")
End Select
myStream.Close()
End If
End Sub
Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
If OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
Dim myReader As New StreamReader(OpenFileDialog1.FileName)
TextBox1.Text = myReader.ReadToEnd
myReader.Close()
End If
End Sub
Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles Me.Load
TextBox1.Multiline = True
TextBox1.Size = New Size(500, 500)
TextBox2.Multiline = True
TextBox2.Size = New Size(500, 500)
TextBox3.Multiline = True
TextBox3.Size = New Size(500, 500)
TextBox4.Multiline = True
TextBox4.Size = New Size(500, 500)
TextBox5.Multiline = True
TextBox5.Size = New Size(500, 500)
End Sub
End Class
The Magic is in the top line " Imports System.IO" Which Sets the reference to The Input/Output Streams.
Just be sure to space the textboxes plenty far apart!
Good Luck