我该如何进行控制(可能是一种FolderBrowser) [英] How can I make this control (may a kind of FolderBrowser)

查看:70
本文介绍了我该如何进行控制(可能是一种FolderBrowser)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如下图所示,它看起来像文件对话框和文件夹浏览器.该对话框只能选择文件夹(不能选择文件).这是自定义控件吗?如果是这样,那么请给我一些建议.这是一个Winforms应用程序.

解决方案

它是OpenFileDialog的基于Vista IFileDialog的本机版本.启用FOS_PICKFOLDERS.该选项未在.NET中公开,在Windows的早期版本中不可用.您可以从 Windows API代码包的CommonOpenFileDialog.IsFolderPicker属性获取包装器. >

As you can see in the picture below, this looks like a file dialog and folder browser. This dialog can select only folder(not file). Is this a custom control? If so, then please give me advice on how to make it. This is a Winforms application.

解决方案

It is the native Vista IFileDialog based version of OpenFileDialog. With the FOS_PICKFOLDERS turned on. That option is not exposed in .NET, it isn't available on earlier versions of Windows. You can get a wrapper for it from the Windows API Code Pack, CommonOpenFileDialog.IsFolderPicker property.

这篇关于我该如何进行控制(可能是一种FolderBrowser)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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