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 .

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

can u give the code ?

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

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
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.