加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

vb6 – 如何仅使用通用对话框控件选择文件夹

发布时间:2020-12-17 00:20:07 所属栏目:大数据 来源:网络整理
导读:使用VB6 码. CommonDialog1.DialogTitle = "Open File"CommonDialog1.Filter = "*.*"CommonDialog1.FilterIndex = 1CommonDialog1.Flags = cdlOFNAllowMultiselect + cdlOFNExplorerCommonDialog1.Flags = cdlOFNFileMustExist + cdlOFNHideReadOnlyCommonDi
使用VB6

码.

CommonDialog1.DialogTitle = "Open File"
CommonDialog1.Filter = "*.*"
CommonDialog1.FilterIndex = 1
CommonDialog1.Flags = cdlOFNAllowMultiselect + cdlOFNExplorer
CommonDialog1.Flags = cdlOFNFileMustExist + cdlOFNHideReadOnly
CommonDialog1.CancelError = True
On Error Resume Next
CommonDialog1.ShowOpen
If Err Then
    'MsgBox "Select Folder"
    Exit Sub
End If

从上面的代码,我选择一个文件,但我不想选择一个文件,我只想选择该文件夹.如何修改我的代码.

需要vb6代码帮助?

已经有一段时间了,因为我必须做任何视觉基础工作,但我认为不是使用通用对话框来获取要打开的文件的名称,您应该使用已经是Windows API一部分的SHBrowseForFolder函数.这是一个描述它用法的页面的 link.

更新(2017年):提供的链接已损坏,但a backed-up version can be viewed on archive.org

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读