Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.Windows.Forms
- Imports System.IO
- Public Class Form1
- Dim ofd As New OpenFileDialog
- Dim sfd As New SaveFileDialog
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- End Sub
- Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click
- Me.Close()
- End Sub
- Private Sub OpenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenToolStripMenuItem.Click
- With ofd
- .Filter = ("Text Files|*.txt")
- .ShowDialog()
- .FileName = " "
- If .ShowDialog = 1 Then
- IO.File.ReadAllText(ofd.FileName)
- End If
- End With
- End Sub
- Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
- End Sub
- Private Sub SaveToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveToolStripMenuItem.Click
- With sfd
- .Filter = ("Text Files|*.txt")
- .ShowDialog()
- .FileName = ""
- If .ShowDialog = 1 Then
- IO.File.WriteAllText(.FileName, TextBox1.Text)
- End If
- End With
- End Sub
- Private Sub SaveFileDialog1_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles SaveFileDialog1.FileOk
- End Sub
- Private Sub AboutToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AboutToolStripMenuItem.Click
- MessageBox.Show("Created by Shannon!")
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement