3

您可以使用

SelectFolder() 获取文件夹

或者

GetOpenFolderitem(filter as string) 获取文件

但是您可以选择文件夹或文件吗?(或为此选择多个文件)

4

4 回答 4

5

MonkeyBread 插件在 OpenDialogMBS 类中允许这样做。

http://www.monkeybreadsoftware.net/pluginhelp/navigation-opendialogmbs.shtml

OpenDialogMBS.AllowFolderSelection as Boolean
property, Navigation, MBS Util Plugin (OpenDialog), class OpenDialogMBS, Plugin version: 7.5, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Whether folders can be selected.
Example: 
dim o as OpenDialogMBS
dim i,c as integer
dim f as FolderItem

o=new OpenDialogMBS
o.ShowHiddenFiles=true
o.PromptText="Select one or more files/folders:"
o.MultipleSelection=false
o.ActionButtonLabel="Open files/folders"
o.CancelButtonLabel="no, thanks."
o.WindowTitle="This is a window title."
o.ClientName="Client Name?"
o.AllowFolderSelection=true
o.ShowDialog

c=o.FileCount
if c>0 then
  for i=0 to c-1
    f=o.Files(i)

    FileList.List.AddRow f.AbsolutePath
  next
end if


Notes: 
Default is false.
Setting this to true on Windows or Linux has no effect there.
(Read and Write property)
于 2008-10-04T10:38:36.947 回答
0

这是不可能通过任何内置 API 实现的。可能有一个插件可以做到这一点,但我认为没有操作系统支持它。

于 2008-09-30T16:21:21.147 回答
0

有点晚了,但它已包含在最近的版本中。我会把它放在这里,以防有人在这个问题上像我一样绊倒:

RealBasic 多选:OpenDialog.MultiSelect

于 2011-09-09T19:42:38.493 回答
-3

假设您使用的是.Net,我认为您需要创建自己的控件(或购买一个)。

于 2008-09-19T07:29:28.247 回答