Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I customized the <code>FolderBrowser</code> dialog a couple of years ago. I made it display the input field where the user may specify a path without having to browse for it. I <em>think</em> that can be customized to show files as well as folders.</p> <p>This is how I did the customization:</p> <p>I used .NET Reflector to disassemble the code for <code>FolderBrowserDialog</code>. I saved the disassembled code as <code>MyFolderBrowserDialog</code>. </p> <p>In the reflected code I found that <code>FolderBrowserDialog</code> calls the unmanaged windows function <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/bb762115%28v=vs.85%29.aspx" rel="nofollow"><code>SHBrowseForFolder</code></a> which accepts a <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/bb773205%28v=vs.85%29.aspx" rel="nofollow"><code>BROWSEINFO</code></a> struct as parameter. The <code>BROWSEINFO</code> struct has the <code>ulFlags</code> member which is a flags value that may be bitmasked to include the features you want to use.</p> <p>In <code>MyFolderBrowserDialog</code> bitmasked <code>BIF_EDITBOX (0x00000010)</code> into the <code>ulFlags</code> to get the input field.</p> <p>According to the documentation if you bitmask <code>BIF_BROWSEINCLUDEFILES (0x00004000)</code> into <code>ulFlags</code> it should include files as well as folders and thus solve your problem. </p> <p>I haven't actually tried to get it to display files, but I think it may be worth a shot.</p> <p>Hope this helps!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload