如何创建一个类似浏览器的文件夹浏览器控件? [英] How to create an Explorer-like folder browser control?

查看:368
本文介绍了如何创建一个类似浏览器的文件夹浏览器控件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用VS2008中的C#和WinForms,我想创建一个文件浏览器控件,看起来就像在Windows资源管理器左侧窗格中。令我惊讶的是,这样的控制不随.NET默认情况下。

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.

在理想情况下,我想它的内容是完全一样的资源管理器。例如,在Windows 7中,它应该显示在收藏夹和库伪文件夹。当然,我也不想code专门为每个版本的Windows,如果我能帮助它。

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.

我已经浏览周围,并有这样的控制的一些例子,但它们都是手卷,因此将不工作100%相同的1在资源管理

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提供一个演练创建Windows资源管理器风格的界面在C#中

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

有也 code计划和其他网站的几个例子。近期的例子是资源管理器树,的我的浏览器文件浏览器先进的文件管理器但也有其他人。 Explorer树似乎看最好​​从短暂的一瞥我花了。

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.

我用谷歌搜索词 Windows资源管理器树视图C#找到这些链接。

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

这篇关于如何创建一个类似浏览器的文件夹浏览器控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆