How to display hidden files in a open files dialog box?

We have an event for that:

OpenDialogMBS.FilterItem(file as folderitem, filterMode as Integer) as boolean

So you can disable items based on your own decision.

Yes, you could grey out invisible files like those not accepted from the filters already do, using that event, but my point is: the dialogs are already greying out filtered items (those whose the filters aren’t matching), so if one wants to show invisible, yet accepted, files, but grey them out, better to not show them in the first place, otherwise they are just greyed out like others.

1 Like

So, I wonder, can we go so far as to display only the invisible files in the boxes in the “OpenDialogMBS” (Files) or/and “NSOpenPanelMBS” (Folders) dialog box ?
Thank you for your patience :sweat_smile:

You can’t show only invisible files in these dialogs, as visible files will always be shown. However, you may grey out all visible files and enable all invisible files.

You said “However, you may grey out all visible files and enable all invisible files.”
Yes, that’s exactly what I want to do. But how to formulate the filters params with “OpenDialogMBS .FilterItem” and the opposite, on the other side (gray out all invisible files and enable visible files).
By default (without filters) visible and invisible are enabled !

OpenDialogMBS .FilterItem(file as folderitem, filterMode as Integer) as boolean

1 Like

Given a filter that allows all files to be selected (or no filter at all), you then use the FilterItem event to allow only invisible files.
Something like this in the FilterItem event:

if file<>nil and file.visible then return true //Disable a visible file