OpenFileDialog.AllowMultipleSelections
From Xojo Documentation
Property (As Boolean )
aOpenFileDialog.AllowMultipleSelections = newBooleanValue
or
BooleanValue = aOpenFileDialog.AllowMultipleSelections
New in 2019r2
Supported for all project types and targets.
or
BooleanValue = aOpenFileDialog.AllowMultipleSelections
New in 2019r2
Supported for all project types and targets.
If True, the dialog supports multiple file selections. The default is False.
Notes
ShowModal still returns a FolderItem, but in the case of a AllowMultipleSelections OpenFileDialog, the FolderItem returned will be the first selection. To obtain a list of all the selected FolderItems, use the SelectedFiles to iterate through them.
Sample Code
Let user choose multiple files and displays them in a Listbox:
Var dlg As New OpenFileDialog
dlg.ActionButtonCaption = "Select Files"
dlg.CancelButtonCaption = "Cancel"
dlg.SuggestedFileName = ""
dlg.Title = "Select Files"
dlg.PromptText = "Select one or more files"
dlg.InitialFolder = SpecialFolder.Documents
dlg.AllowMultipleSelections = True
Var f As FolderItem = dlg.ShowModal
For Each file As Folderitem In dlg.SelectedFiles
Listbox1.AddRow(file.Name)
Next
dlg.ActionButtonCaption = "Select Files"
dlg.CancelButtonCaption = "Cancel"
dlg.SuggestedFileName = ""
dlg.Title = "Select Files"
dlg.PromptText = "Select one or more files"
dlg.InitialFolder = SpecialFolder.Documents
dlg.AllowMultipleSelections = True
Var f As FolderItem = dlg.ShowModal
For Each file As Folderitem In dlg.SelectedFiles
Listbox1.AddRow(file.Name)
Next