OpenFileDialog.SelectedFiles

From Xojo Documentation

Method

OpenFileDialog.SelectedFiles(resolveAlias as Boolean = True) As Iterable

New in 2019r2

Supported for all project types and targets.

Allow you to iterate through all the files the user selected in the open file dialog box.

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