How to create an Explorer-like folder browser control? - c#

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?

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.

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.

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

Related

Standard drive/network tree view in c#

Is there a control that I can use that operates like windows explorer for selecting drives and network resources or does this functionality have to be built from scratch? Specifically I am talking about the left panel of explorer where you can select the different drives on the PC or the network.
I went through the list of the default controls and I don't see one offhand.
Thanks!

Building a Windows Explorer Extension

I'm looking to build an application that will rely on adding menu extensions to the menu that appears when one right clicks a file or folder. I've heard that you can build it in Python, here are the resources that I am currently looking at:
http://docs.python.org/extending/extending.html
http://docs.python.org/extending/windows.html#building-on-windows
However I'm not quite sure if I'm even looking in the right direction for this kind of stuff. What should I be searching for, and is it possible to build this kind of thing in Python or will I have to learn C#/.NET?
Thanks!
Edit: Looks like these things are called context menus and involves adding entries to the registry in order to associate applications with certain file types. In that case, should I have my application listening in the background for actions from the entry? Also if you know how to do the same thing in OS X or have some nifty cross-platform thing for this, that would be really nifty!
Here is a sample code at Sample code .
Another way is to manipulate the Registry by using the Windows Explorer tool, like the Open with option. Use it to associate a file extension with opening an executable, basically. However, this technique does not add a menu item into Windows Explorer. But it's easier.

Windows Explorer control for WPF?

Is there a way to have a Windows Explorer on WPF? The closes I can get is the Web Browser, but it's not really what I need.
Please assist.
Thanks
Check these out -
http://www.codeproject.com/KB/WPF/WPF_Explorer_Tree.aspx
and
http://gargmanoj.wordpress.com/2009/03/27/wpf-101-a-simple-windows-explorer-like-directory-browser/
JAM Software recently released a WPF edition of their ShellBrowser controls. They contain a wrapped Windows Explorer as well as custom built tree and list controls. Also included is a preview control similar to the one in the Windows Explorer on the right. Full disclosure: I am one of the developers of ShellBrowser.
Check out the explorer browser control in the Windows API Code Pack. Compatible with Vista and 7, I believe.
I have written a WinForms library that might help. It's not WPF but you can host it in a WPF application.
You can find the library at: http://gong-shell.sourceforge.net/
You can also check this out. It's fresh to the market and you'll need to pay, but it was designed to be identical in every way to the Windows Explorer Chrome:
http://www.teraque.com/products/explorer-chrome-suite/
The controls you get for free from WPF look like crap. They are only meant to get developers started.

Implementing Folder Explorer with webbrowser C# winform

I' trying to use webbrowser to create a folder explorer and I have few problems that I could not find any answer on the web... so I’ll appreciate your answers:
Can someone please explain how can I create the Up button (going to parent folder)?
How can I the explorer bar (on the left) to favorites or search as in windows explorer?
How can I implement the undo functionality (undelete files and folders)
What I would do intercept calls to a url and inject the data from your application. That way you can write HTML and display whatever functionality you want.
This Code Project WebBrowser Control might be useful too. I wouldn't be surprised if it allows you to handle the button click events on the navigation bar.

Embed a File Chooser in a UserControl / Form

I've inherited a desktop application which has a custom .NET file chooser that is embedded in a control, but it has some issues.
I'd like to replace it with a non-custom File Chooser (like the OpenFileDialog).
However, for a variety of reasons it needs to be embedded in the parent control not a popup dialog.
Is there a control I'm missing, or does MS only provide the popup dialog out of the box?
The .Net control is a thin wrapper for the common dialog built into windows, and that is a dialog. So there is no way to embed it as though it were a control.
Depending on your needs, you COULD abuse the web browser control to show local files and folders. It won't match all the functionality of the OpenFileDialog, but it could work.
Here's one that I remembered from way-back. The Shell Mega-Pack. It has ActiveX and .NET versions. It looks promising.
Alternatively, if you want to build your own, you could start here on CodeProject: A Windows Explorer in a User Control. That looks like a good start. Here's another one: An All VB.NET Explorer Tree Control with ImageList Management.

Categories

Resources