O'Reilly logo

VB.NET Language in a Nutshell, Second Edition by Steven Roman PhD, Paul Lomax, Ron Petrusha

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

SaveFileDialog Class

Namespace

System.Windows.Forms

Createable

Yes

Description

Represents a common dialog box for selecting or saving a file. The most common use of this dialog box is to ask the user for the name of a file, after which we can use VB’s functions to save an existing file under that name, since the dialog box itself does not handle the process of saving a file.

The SaveFileDialog object has properties for setting the initial appearance and functionality of the dialog box, a property for returning the filename selected by the user, as well as a method for showing the dialog box. The object does not itself save the file, but instead provides the information that allows your code to do this programmatically.

A SaveFileDialog object can be instantiated as follows:

Dim oSaveDlg As New SaveFileDialog

Selected SaveFileDialog Members

The following is a brief list of some of the more important members of the SaveFileDialog class:

AddExtension property

Gets or sets a Boolean value that determines whether the default file extension is automatically added to the FileName property if the user fails to enter an extension. Its default value is True.

DefaultExt property

Gets or sets a String that defines the default file extension. The string should consist of the file extension only, without a period.

FileName property

Gets or sets a String containing the name that the user selected or entered in the dialog box.

Filter property

Gets or sets a String containing the current filter, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required