Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System
- Imports System.IO
- Public Class Form1
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
- TextBox6.Visible = True
- Label4.Visible = True
- 'Opens an SaveFileDialog with .txt pre specified in the filter asking for a name for our file
- SaveFileDialog1.Filter = "TXT Files (*.txt*)|*.txt"
- If SaveFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK _
- Then
- 'Writes all text to the newly created file
- My.Computer.FileSystem.WriteAllText _
- (SaveFileDialog1.FileName, RichTextBox1.Text, True)
- 'Removes button1
- Button1.Visible = False
- End If
- 'Gives the path a name and shows it for refernce
- Dim path As String = IO.Path.GetDirectoryName(SaveFileDialog1.FileName)
- TextBox6.Text = Path
- Button2.Visible = True
- End Sub
- 'Displays the text from textboxes 1-3
- Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
- RichTextBox1.Text = TextBox1.Text & vbCrLf & TextBox3.Text & vbCrLf & TextBox2.Text
- End Sub
- 'Closes the application
- Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
- Me.Close()
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement