Dela via


How To: Add a Custom Place to a File Dialog Box

The default open and save dialog boxes on Windows Vista have an area on the left side of the dialog box titled Favorite Links. This area is called custom places. The OpenFileDialog and SaveFileDialog classes allow you to add folders to the CustomPlaces collection.

Note

In order for a custom place to appear in the OpenFileDialog or SaveFileDialog, the AutoUpgradeEnabled property must be set to true (the default).

To add a custom place to a file dialog box

  • Add a path, a Known Folder GUID, or a FileDialogCustomPlace object to the CustomPlaces collection of the dialog box.

    The following code example shows how to add a path:

    OpenFileDialog1.CustomPlaces.Add("C:\MyCustomPlace")
    
    openFileDialog1.CustomPlaces.Add("C:\\MyCustomPlace");
    

See Also

Reference

FileDialog

FileDialogCustomPlacesCollection.Add

Concepts

Known Folder GUIDs for File Dialog Custom Places

Other Resources

FileDialog Class