Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to show hidden folders in a default FolderBrowserDialog?

Tags:

c#

.net

winforms

I am using a System.Windows.Forms.FolderBrowserDialog to let a user select a location. The default location the user may override is located in %appdata%.

As long as the user is somewhere below %appdata% (the dialog opens at the currently set location, so per default the one below "AppData"), he can see and chose "Local", "LocalLow" and "Roaming", which are usually hidden like the "AppData" folder itself.

I do not want to touch Windows settings for showing hidden files etc. but I do not find any property that will let me show all hidden files/folders by default.

What am I missing?

(I already took a look at MSDN)

I added some screenshots:

Hidden folders are visible as the initial directory was "Local": Hidden folders visible

Hidden folders are NOT visible: Hidden folders are not visible

thanks in advance.

like image 733
christian.s Avatar asked Sep 13 '25 20:09

christian.s


1 Answers

An almost very dirty solution is to change the registry value of HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden while loading your window and restore it to the previous value when you close it.

like image 76
Pablo Honey Avatar answered Sep 15 '25 10:09

Pablo Honey