1

How can I restrict the list of drive letters displayed by the WPF SaveFileDialog?

javacavaj
  • 2,901
  • 5
  • 39
  • 66

1 Answers1

3

IMHO Since it is just a wrapper over the old FileDialog common control, I'd be surprised if you could do this. I could be wrong...

I'd begin by questioning why you need to restrict some drives (Windows- Group policies and other security mechanisms should take care of user rights) If you really need this.. I'd go for

  • Override the FileOk event, check the drive in the selected path and cancel the event if the path is not permissible. Also notify the user explaining the reason for denial
  • If that's not good for UX reasons, you could tinker around with registry and/or group policy keys to hide the drive. Googling should give you some pointers.. but I'd not do this myself. Not recommended.
Gishu
  • 134,492
  • 47
  • 225
  • 308