Filtering selectfolderdialog

Hi, is there a way to get the contents (an filter it) of the folders to show on windows in the selectfolderdialog? simular to how macOS shows it.

The selectfolderdialog.filter property does appear to work on macOS or windows.

Online documentation

Obviously, I can use the openFileDialog, but we are trying to resolve missing folders of multiple images. So the matching is not a 1 to 1 match.

I do not understand (the above and the whole).

Filtering files on Windows works far better than its macOS counterpart…

If you want to display folders only, use SelectFolder or SelectFolderDialog …

The problem with SelectFolderDialog on Windows is that, by default, it hides all the contents of the currently selected folder (except any subfolders in that folder). If you are trying to select the folder containing a specific file or files, they can’t be seen so you can’t visually confirm that you have the correct folder.

In theory, you should be able to use the filter property to show some selected content but it doesn’t work.

SelectFolderDialog works for filtering items and only allow to select… folder(s)…
If you want to filter Items (files), use either OpenDialog or SaveAsDialog in conjunction with one or many FileTypeSet(s) and you will get the items (files) that correspond to the FileTypeSet you passed AND folders.

What does not works ?

If this answer is not what you want, please share the used code.

dlg.Filter = FileTypes1.All // Will let you see and/or choose all items defined in FileType1

Emile,

Sorry that doesn’t work on Windows - only the folders are shown. See screen grabs below of the differences between the SelectFolderDialog on OSX and Window.

https://www.dropbox.com/s/kiwmm3q93q3z46d/OSX.jpg?dl=0
https://www.dropbox.com/s/d40g5vakwf4eent/Windows_10.jpg?dl=0

As I mentioned above, we want to only allow selection of a folder but display all the other contents of the folder on Windows the same way that it works on OSX.

I understand, but the important part is… you cannot select a file, only saw them, disabled !

I do not have a Windows 10 machine handly.

Peter:

Even if you use SelectFolderDialog to be able to select a Folder (and only a folder), you will still can see these disabled files.

This is a platform difference. To be sure, try all application(s) you have on macOS and…

Even Xojo (2018r2) do that on macOS X.

In what sense?

I would argue that filtering in MacOS works as badly than Windows, since MacOS decided to go with extensions only rather than type and creator as existed before, but I’ve made my peace for this.

I’m interested in how it might be perceived as “better” in Windows though.