0

As Rie819 has pointed out, this is a duplicate question. However, the other post does not discuss how to create a custom Dialog with this feature. With that being said, I will revise my question and ask for tips on how to do this.


Alright, so I've looked in the MSDN library and also attempted to find the solution to this elsewhere, but I seem to be missing something here....

So my issues are while using OpenFileDialog and SaveFileDialog, I want the user to be restricted to a specific folder, so they can only save/open there. In other words, they cannot browse away from the InitialDirectory I've setup.

Is there a simple value I'm missing that sets this? If it's an obvious solution I'm going to kick myself for this one....

Thanks in advance,

Charles
  • 50,943
  • 13
  • 104
  • 142
JWiley
  • 3,129
  • 8
  • 41
  • 66
  • duplicate: http://stackoverflow.com/questions/1635846/c-sharp-openfiledialog-lock-to-directory – rie819 Mar 13 '12 at 17:43
  • Thank you, rie819. With that being said, is there a similar post discussing a custom Dialog with this feature? – JWiley Mar 13 '12 at 17:49
  • Not sure, but it should be pretty quick to whip up. Create a form that has the elements you want then display it in a modal manner. You can read the file directory from the config file and away you go. Is there a particular part that you would like elaborated? – rie819 Mar 13 '12 at 17:54
  • I don't believe so, was just curious that it wasn't already a post somewhere. Thanks for all the help! – JWiley Mar 13 '12 at 18:03
  • ....actually yes. Can I not upvote you for a comment? Or close this question/mark it answered? – JWiley Mar 13 '12 at 19:00
  • Added an answer so you can mark it if you choose. – rie819 Mar 13 '12 at 19:08

1 Answers1

1

Duplicate question. See here for resolution.

Essentially you have two options. 1 - catch if the user changes the directory. 2 - Create your own custom save dialog box.

Community
  • 1
  • 1
rie819
  • 1,249
  • 12
  • 19