Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

how to set the "My Documents" as initial directory for System.Windows.Forms.SaveFileDialog

$
0
0

 

 

 

Hello!

 

I have several Open File dialogs and a Save File dialog in my app. For the  Save File dialog, I wanted to make the "My Documents" as the initial directory. How do I do that? I use the statement below:

 

saveDlg

.InitialDirectory =Environment.SpecialFolder.MyDocuments.ToString();

 

but somehow this will not open the My Documents directory since the Environment.SpecialFolder.MyDocuments.ToString will return this string "Personal."  So, the dialog would open the initial directory I set for my Open File dialog, why is that?

 

Please help!

 

Thanks!

 


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>