Advertisement
King_96

getInfo V2

Feb 11th, 2015
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.87 KB | None | 0 0
  1. Imports System
  2. Imports System.IO
  3. Public Class Form1
  4.  
  5.     Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  6.         TextBox6.Visible = True
  7.         Label4.Visible = True
  8.         'Opens an SaveFileDialog with .txt pre specified in the filter asking for a name for our file
  9.         SaveFileDialog1.Filter = "TXT Files (*.txt*)|*.txt"
  10.         ' I named the file so the next app what to grab
  11.         SaveFileDialog1.FileName = "King96"
  12.         ' Set the default to desktop
  13.         SaveFileDialog1.InitialDirectory = _
  14.             Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
  15.         If SaveFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK _
  16.         Then
  17.             'Writes all text to the newly created file
  18.             My.Computer.FileSystem.WriteAllText _
  19.             (SaveFileDialog1.FileName, RichTextBox1.Text, True)
  20.             'Removes button1
  21.             Button1.Visible = False
  22.         End If
  23.         'Gives the path a name  and shows it for refernce
  24.         Dim path As String = IO.Path.GetDirectoryName(SaveFileDialog1.FileName)
  25.         TextBox6.Text = Path
  26.         Button2.Visible = True
  27.     End Sub
  28.     'Displays the text from textboxes 1-3
  29.     Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
  30.         RichTextBox1.Text = TextBox1.Text & "/" & TextBox2.Text & "/" & TextBox3.Text & "/"
  31.     End Sub
  32.  
  33.     'Closes the application
  34.     Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
  35.         Me.Close()
  36.     End Sub
  37.  
  38.     Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
  39.         TextBox1.Text = " "
  40.         TextBox2.Text = " "
  41.         TextBox3.Text = " "
  42.     End Sub
  43.  
  44.     Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
  45.         RichTextBox1.Text = " "
  46.     End Sub
  47. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement