Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub GuardarToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GuardarToolStripMenuItem.Click
- SaveFileDialog1.ShowDialog()
- If My.Computer.FileSystem.FileExists(SaveFileDialog1.FileName) Then
- Dim ask As MsgBoxResult
- ask = MsgBox("File already exists, would you like to replace it?", MsgBoxStyle.YesNo, "File Exists")
- If ask = MsgBoxResult.No Then
- SaveFileDialog1.ShowDialog()
- ElseIf ask = MsgBoxResult.Yes Then
- My.Computer.FileSystem.WriteAllText(SaveFileDialog1.FileName, TextBox1.Text, False)
- End If
- Else
- My.Computer.FileSystem.WriteAllText(SaveFileDialog1.FileName, TextBox1.Text, False)
- End If
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement