如何在vb.net中选择文件和文件夹 [英] How to choose both files and folder in vb.net

查看:895
本文介绍了如何在vb.net中选择文件和文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在使用文件夹浏览器选项来选择文件夹,但是现在我的要求是我必须使列表中的文件和文件夹都可以去显示,以便用户可以选择他想要的文件,如何操作

Hi
I am using the folder browser option to select the folders but now my requirement is that I have to make it possible to deisplay both the files and folders in a list so that the user can select the one he wishes to, how to do it

推荐答案

您不能使用标准的浏览器控件-文件和文件夹必须通过不同的对话框进行浏览-它们是sealed,因此您无法派生从他们那里.
我只能建议您创建一个自定义对话框,该对话框可以执行您想要的操作-它可以根据需要包含文件或文件夹.
You can''t, with the standard browser controls - files and folder have to be browsed for by different dialogs - and they are sealed so you cannot derive from them.
The only thing I can suggest is that you create a custom dialog, which does what you want - it could include files or folders as required.


使用FolderBrowserDialog或OpenFileDialog,因此您必须为自己创建一些东西.抱歉.
It is not possible using either the FolderBrowserDialog or the OpenFileDialog, and so you would have to create something for yourself. Sorry.


这篇关于如何在vb.net中选择文件和文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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