OpenFileDialog1.ShowDialog() [英] OpenFileDialog1.ShowDialog()

查看:206
本文介绍了OpenFileDialog1.ShowDialog()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用OpenFileDialog1.ShowDialog()作为文件名和路径.

想知道是否可以不接受包含空格的文件名吗?如果文件名中有空格,则可能会出现/warding/msgBos错误?

解决方案

内置对话框是其中的一部分操作系统.

这就是为什么它们在几乎所有程序中都相同的原因.

功能有限,并且您要使用的功能AFAIK不存在.

https://msdn .microsoft.com/en-us/library/windows/desktop/ff468806(v = vs.85).aspx

如果您有特殊目的,则必须使用带有ShowDialog的Windows窗体来构建自己的窗体.

请注意,它并不像乍看起来那样容易.您很少看到带有用户构建对话框的程序.



Hi,

I am using OpenFileDialog1.ShowDialog() to the file name and path.

Wondering if its possible to NOT accept file names that contains spaces? If there is space in the file name, maybe some error /warding /msgBos can appear ?

解决方案

The in build dialog boxes are part of the Operating System. 

That is the reason they are in almost in all programs the same. 

The features are limited and AFAIK the feature you ask for does not exist. 

https://msdn.microsoft.com/en-us/library/windows/desktop/ff468806(v=vs.85).aspx

If you want special purposes you have to build your own by using windows forms which shows with a ShowDialog.

Be aware, it is not as easy as it looks at first sight. You seldom see programs who have an user build dialog box. 



这篇关于OpenFileDialog1.ShowDialog()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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