0

i making a list of names to be entered in 10 boxes. no i need to save this as document or text file. how do i use savefiledialog() in vb .

4
Contributors
4
Replies
6
Views
5 Years
Discussion Span
Last Post by Sahil89
0

First make the form and add what you want.Then go to file menu and click to save command or cick ctrl+S.

0

First you add a FileSaveDialog object to your form by dragging and dropping from the toolbox. After you have done that, select the control and browse the properties. Each property has a description that explains what it is for. To prompt the user for a filename you do

If SaveFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
    MsgBox("you selected " & SaveFileDialog1.FileName)
End If
0

You must search using google before posting any question. Following is the code to save text file

        Dim svFileDialog As New SaveFileDialog
        svFileDialog.Filter = "Text file|*.txt"
        svFileDialog.Title = "Save text file"
        svFileDialog.ShowDialog()

        If Not svFileDialog.FileName = "" Then
            System.IO.File.WriteAllText(svFileDialog.FileName, "your Text")
        End If

Edited by Sahil89

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.