使用打开文件对话框将文件列表添加到列表框 [英] Adding list of files to listbox using open file dialog

查看:105
本文介绍了使用打开文件对话框将文件列表添加到列表框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


不知道该怎么做,但会尝试。



我有一个文本框,我用来将文件上传到数据库,它工作正常。我已经将文本框更改为列表框。我尝试使用文件打开对话框将多个文件添加到列表框时遇到问题,以便将它们添加到数据库中。


运行时我可以出错确定错误是在这一部分....

展开 | 选择 | Wrap | 行号

解决方案


我有一个文本框,我用来将文件上传到数据库,它工作正常。我已经将文本框更改为列表框。我尝试使用文件打开对话框将多个文件添加到列表框时遇到问题,以便将它们添加到数据库中。


运行时我可以出错确定错误是在这一部分....

展开 | 选择 | Wrap | 行号



请帮我解决上述问题,我明天上午11点(不到24小时)进行演示,该功能是我老板想要看到的关键功能之一。


问候


Lebbsy,


我找到了一个很好的参考资料,包括源代码。请参阅此链接,从主题查找多个文件开始。
http://vb123.com/toolshed/03_docs/filedialog。 htm


我尝试调整参考中提供的代码的相关部分来代替代码。但是,您没有提供所有代码,因此我不需要进行更多调整,特别是对于文件对话框对象。引用文章:我使用FileDialog对象是选择多个图片文件的文件路径。在图4中,我不仅开启了多选,而且还将文件选择器更改为预览模式,以便在选择之前查看图像的样本。让我知道。


将列表框的multi-slelect属性设置为true。

展开 | 选择 | Wrap | 行号



我有一个文本框,我用它上传文件到数据库,它工作正常。我已经将文本框更改为列表框。我尝试使用文件打开对话框将多个文件添加到列表框时遇到问题,以便将它们添加到数据库中。


运行时我可以出错确定错误是在这一部分....

展开 | 选择 | Wrap | 行号


Not sure how to do that, but will try.

I had a text box that I used to upload files to the database, it works fine. I have since changed the text box to a listbox. I am having a problem though with trying to add multiple files to a listbox using the file open dialog so that they can be added to the database.

On running I can an error and am sure the error is on this part....

Expand|Select|Wrap|Line Numbers

解决方案

I had a text box that I used to upload files to the database, it works fine. I have since changed the text box to a listbox. I am having a problem though with trying to add multiple files to a listbox using the file open dialog so that they can be added to the database.

On running I can an error and am sure the error is on this part....

Expand|Select|Wrap|Line Numbers


Please help me with the above, I have a presentation tomorrow at 11 am(in less than 24hrs) and that functionality is one of the key functionalities that my bosses want to see.

Regards

Lebbsy,

I found an excellent reference for you with source code. See this link, starting with the topic, "Finding more than one file"
http://vb123.com/toolshed/03_docs/filedialog.htm

I tried adaptng the relevant portions of the code supplied in the reference in place of your code. However, you did no supply all of your code, so I don''t whether more adaptation is needed, particularly with respect to the file dialog object. To quote from the article:"I use the FileDialog object for is to select the file paths of multiple picture files. In Figure 4, not only have I turned on multi-select but also I have changed the the file picker to preview mode to see samples of the images before I select them." Let me know.

Set the multi-slelect property of your listbox to true.

Expand|Select|Wrap|Line Numbers


I had a text box that I used to upload files to the database, it works fine. I have since changed the text box to a listbox. I am having a problem though with trying to add multiple files to a listbox using the file open dialog so that they can be added to the database.

On running I can an error and am sure the error is on this part....

Expand|Select|Wrap|Line Numbers


这篇关于使用打开文件对话框将文件列表添加到列表框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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