0

I am opening a FolderBrowserDialog for the user to select a folder. However I only want the user to be able to select folders that have an XML file in it. Is there a way for me to achieve this?

Fred
  • 5,663
  • 4
  • 45
  • 74
  • 3
    No easy way - you would need to derive from `FolderBrowserDialog` and implement it yourself, but that class is `sealed`. You'll need to roll your own from scratch, in my opinion. – Roger Rowland Jan 14 '14 at 10:18
  • @RogerRowland I was thinking this was the case but hoping I was wrong. Thanks anyway. – Fred Jan 14 '14 at 10:41
  • Why don't you just re-display it when you find out that the folder doesn't contain any .xml files? Easy peasy. – Hans Passant Jan 14 '14 at 11:35
  • @HansPassant that is an option but I decided to display a message "No XML files found" for now then look at writing my own when I have more time. – Fred Jan 14 '14 at 12:11

0 Answers0