Imports System.Windows.Forms
public class FileOpenDialogFilter
public Shared Sub Main
Dim saveFileDialog1 As System.Windows.Forms.SaveFileDialog
saveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
saveFileDialog1.CreatePrompt = True
saveFileDialog1.FileName = "doc1"
saveFileDialog1.Filter = "Word (*.doc) |*.doc;*.rtf|(*.txt) |*.txt|(*.*) |*.*"
If saveFileDialog1.ShowDialog() = DialogResult.OK Then
Console.WriteLine(saveFileDialog1.FileName)
End If
End Sub
End class
Imports System.Windows.Forms
public class SaveFileDialogWith
public Shared Sub Main
Dim SaveFileDialog1 As SaveFileDialog = New System.Windows.Forms.SaveFileDialog
With SaveFileDialog1
.DefaultExt = ".txt"
.Filter = "Text Files|*.txt"
.InitialDirectory = "C:\My Documents"
End With
If SaveFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
Console.WriteLine(SaveFileDialog1.FileName)
End If
End Sub
End class