Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Form2
- Dim UserTextBox1A As String = Nothing
- Private Sub Form2_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
- Form1.WindowState = FormWindowState.Normal
- End Sub
- Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- End Sub
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- If System.IO.File.Exists(Application.StartupPath & "\TextBox1.txt") Then
- System.IO.File.Delete(Application.StartupPath & "\TextBox1.txt")
- Dim objwriter As New System.IO.StreamWriter(Application.StartupPath & "\TextBox1.txt")
- objwriter.Write(TextBox1.Text)
- objwriter.Close()
- Else
- Dim objwriter As New System.IO.StreamWriter(Application.StartupPath & "\TextBox1.txt")
- objwriter.Write(TextBox1.Text)
- objwriter.Close()
- End If
- End Sub
- Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
- Dim SaveFile As New SaveFileDialog
- SaveFile.FileName = ""
- SaveFile.Filter = "Text Files (*.txt)|*.txt"
- SaveFile.Title = "Save"
- SaveFile.ShowDialog()
- Try
- Dim Write As New System.IO.StreamWriter(SaveFile.FileName)
- Write.Write(TextBox1.Text)
- Write.Close()
- Catch ex As Exception
- End Try
- End Sub
- Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
- If System.IO.File.Exists(Application.StartupPath & "\TextBox1.txt") Then
- Dim objreader As New System.IO.StreamReader(Application.StartupPath & "\TextBox1.txt")
- TextBox1.Text = objreader.ReadToEnd
- objreader.Close()
- Else
- TextBox1.Text = ("No Content To Be Displayed")
- End If
- End Sub
- Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
- Dim OpenFile As New OpenFileDialog
- OpenFile.FileName = ""
- OpenFile.Filter = "Text Files (*.txt)|*.txt"
- OpenFile.Title = "Open"
- OpenFile.ShowDialog()
- Try
- Dim Read As New System.IO.StreamReader(OpenFile.FileName)
- TextBox1.Text = Read.ReadToEnd
- Read.Close()
- Catch ex As Exception
- End Try
- End Sub
- Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
- My.Settings.UserTextBox1 = TextBox1.Text
- My.Settings.Save()
- End Sub
- Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
- TextBox1.Text = My.Settings.UserTextBox1
- If TextBox1.Text = Nothing Then
- TextBox1.Text = "There Is No Content To Be Displayed"
- End If
- End Sub
- Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
- UserTextBox1A = TextBox1.Text
- End Sub
- Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
- TextBox1.Text = UserTextBox1A
- If TextBox1.Text = Nothing Then
- TextBox1.Text = "There Is No Content To Be Displayed"
- End If
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement