Advertisement
King_96

getInfo Application

Feb 9th, 2015
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.29 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.         If SaveFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK _
  11.         Then
  12.             'Writes all text to the newly created file
  13.             My.Computer.FileSystem.WriteAllText _
  14.             (SaveFileDialog1.FileName, RichTextBox1.Text, True)
  15.             'Removes button1
  16.             Button1.Visible = False
  17.         End If
  18.         'Gives the path a name  and shows it for refernce
  19.         Dim path As String = IO.Path.GetDirectoryName(SaveFileDialog1.FileName)
  20.         TextBox6.Text = Path
  21.         Button2.Visible = True
  22.     End Sub
  23.     'Displays the text from textboxes 1-3
  24.     Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
  25.         RichTextBox1.Text = TextBox1.Text & vbCrLf & TextBox3.Text & vbCrLf & TextBox2.Text
  26.     End Sub
  27.  
  28.     'Closes the application
  29.     Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
  30.         Me.Close()
  31.     End Sub
  32. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement