Take the 2-minute tour ×

Using C# and WinForms in VS2008, I want to create a file browser control that looks and acts like the left pane in Windows Explorer. To my astonishment, such a control does not ship with .NET by default.

Ideally, I would like its contents to be exactly the same as in Explorer. For example, on Windows 7, it should show the Favorites and Libraries pseudo-folders. Of course, I do not want to code specifically for each version of Windows if I can help it.

I have browsed around, and there are some examples of such controls, but they are all hand-rolled and therefore won't work 100% the same as the one in Explorer.

Is there any way I can simply reuse the Explorer control instead? Or, if not, to get access to a tree of the items that it would show?

share|improve this question
I suspect the Explorer control just uses a tree control and populates it within the dialog code. I don't think it would be a specific control that displays the folders. I could be wrong. –  Lazarus Mar 10 '10 at 12:59
Are you looking for FolderBrowserDialog? ref: msdn.microsoft.com/en-us/library/… –  shahkalpesh Mar 10 '10 at 13:23
@shahkalpesh: No, essentially I'm looking for the control used inside that dialog. –  Thomas Mar 10 '10 at 16:38
add comment

3 Answers

up vote 12 down vote accepted

Microsoft provides a walkthrough for creating a Windows Explorer style interface in C#.

There are also several examples on Code Project and other sites. Immediate examples are Explorer Tree, My Explorer, File Browser and Advanced File Explorer but there are others. Explorer Tree seems to look the best from the brief glance I took.

I used the search term windows explorer tree view C# in Google to find these links.

share|improve this answer
Again, those are reinventing the wheel, and bound to get it wrong in various corner cases. But I'm accepting this because you provided the largest number of useful links. –  Thomas Mar 10 '10 at 16:37
@Thomas: It think re-inventing the wheel is the only option you have as Windows doesn't expose that control for use outside of Explorer. –  Jeff Yates Mar 10 '10 at 17:24
add comment

It's not as easy as it seems to implement a control like that. Explorer works with shell items, not filesystem items (ex: the control panel, the printers folder, and so on). If you need to implement it i suggest to have a look at the Windows shell functions at http://msdn.microsoft.com/en-us/library/bb776426(VS.85).aspx.

share|improve this answer
"It's not as easy as it seems to implement a control like that." I realize that. Which is exactly why I would prefer not to reinvent the wheel. –  Thomas Mar 10 '10 at 13:12
add comment

Take a look at Shell MegaPack control set. It provides Windows Explorer like folder/file browsing with most of the features and functionality like context menus, renaming, drag-drop, icons, overlay icons, thumbnails, etc

share|improve this answer
I had already run into that. If this weren't my first commercial application, I'd happily pay those $299, but as it stands, I can't afford that. –  Thomas Mar 10 '10 at 16:34
add comment

Your Answer


