There's something that looks suspiciously like it that *is* designed to
select a folder though. In VS2005, open the Tools/Options window, select
the
root "Projects and Solutions" tree node and then click the "..." button
next
to one of the location boxes at the top of the dialog. That definitely
looks
like the OpenFileDialog to me, and it's selecting a folder rather than a
file.
Can the OpenFileDialog do that? I must confess I haven't tried it.
It probably is based on the OpenFileDialog, though I suppose you'd have to
watch it in a debugger to be sure (or ask the guy who wrote it). You
could do something similar by creating a new dialog derived from the
OpenFileDialog and/or the native Win32 common file open dialog, and
overriding the base behavior so that the "Open" button returns with path
and no filename.
But it's a big UI mistake to do that, IMHO. I don't see what the fuss
about the folder browser dialog is. I agree it'd be nice to have better
typing control over the browser, but overloading the file browser to
return folders results in some pretty user-unfriendly behavior.
In the example you describe, contrary to what the user normally expects,
selecting a folder and clicking the "Open" button dismisses the dialog
rather than descending into the directory tree. The fact that the dialog
looks so much like the usual common dialog makes the behavior that much
worse; it should at least be visibly and significantly different from the
standard dialog, to ensure the user understands they are dealing with
something different.
The folder browser dialog makes it very clear that you're doing something
different from choosing a file. The UI is so different, there's no chance
the user will get confused about what button does what.
VS should have used the folder browser in that situation. They've
violated the basic rule of UI: the rule of least surprise.
Pete