Saturday, August 7, 2010

How To Use The SaveFileDialog

First add a button or a menu strip saying "Save"
Double click on the button or menu strip
Put in this code: (You do not need to put in a SaveFileDialog)


  Dim SaveFile As New SaveFileDialog
        SaveFile.FileName = "Keys"
        SaveFile.Filter = "Text Files|*.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


The whole thing will be like this:




















I won't be posting much unless after 24th of September as I am having a test
If you have any request about VB tutorials
Then send me an email
Email: tutorialsvb@hotmail.com

No comments:

Post a Comment