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"
- ' I named the file so the next app what to grab
- SaveFileDialog1.FileName = "King96"
- ' Set the default to desktop
- SaveFileDialog1.InitialDirectory = _
- Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
- 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 & "/" & TextBox2.Text & "/" & TextBox3.Text & "/"
- End Sub
- 'Closes the application
- Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
- Me.Close()
- End Sub
- Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
- TextBox1.Text = " "
- TextBox2.Text = " "
- TextBox3.Text = " "
- End Sub
- Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
- RichTextBox1.Text = " "
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement