Imports System.IO
Public Class Form5
Private Sub Label3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim FileName As String
Dim sw As StreamWriter
Try
With SaveFileDialog1
.FileName = FileName
.Filter = "Text Files (*.txt)|*.txt|" & "all files|*.*"
If .ShowDialog() = DialogResult.OK Then
FileName = .FileName
sw = New StreamWriter(FileName)
sw.Write(TextBox1.Text & vbCrLf)
sw.Write(TextBox2.Text & (ControlChars.NewLine))
sw.Write(TextBox3.Text)
sw.Write(TextBox4.Text)
sw.Write(TextBox5.Text)
sw.Write(TextBox6.Text)
sw.Write(DateTimePicker1.Text)
sw.Write(DateTimePicker2.Text)
End If
End With
Catch ex As Exception
MessageBox.Show("Message")
Finally
If Not (sw Is Nothing) Then
End If
End Try
End Sub