VBBRett
asked on
How do you set memory for the OpenFileDialog so that it opens in the same directory as the last time you saved/opened a file?
I was wondering how to set memory for the OpenFileDirectory or SaveFildirectory so that when a file dialog is opened, it opens in the same directory as the last time you used the open file dialog or the same directory as the last time you used the save dialog box. Any takers? It's worth 500 big points! How would I code this in VB.NET For a Windows Form?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
dlg.InitialDirectory = directory
When dialog is closed, get directory from it's FileName property:
directory = Path.GetDirectoryName(dlg.
Use directory for the next call to Open/Save dialog. If you want to keep initial directory persistent, keep it in the Registry or application settings.