STATIC FUNCTION OpenFile ( [ Multi AS Boolean ] ) AS BooleanCalls the file standard dialog to get the name of a file to open.
Dialog.Title = "Choose a file" Dialog.Filter = ["*.txt", "Text Files", "*", "All files"] Dialog.Path = "." IF Dialog.OpenFile() THEN RETURN ' User pressed Cancel - ENDIF
This example shows how you can select multiple files with the OpenFile dialog. By setting the Dialog.Path when the application starts the first time the dialog is opened it will show the users home directory.
PUBLIC SUB Form_Open() Dialog.Path = User.Home END PUBLIC SUB ButtonOpenMultiple_Click() DIM imageFile AS String Dialog.Filter = ["*.png", "Portable Network Graphics"] IF Dialog.OpenFile(TRUE) THEN RETURN FOR EACH imageFile IN Dialog.Paths PRINT imageFile NEXT CATCH Message.Info(Error.Text) END