Skip to content

MultiSelect_State - OpenDialog

Determines whether users can select more than one file

Type: Property
Access: Read/Write
Data Type: Boolean
Parameters: None

Syntax

Property Boolean MultiSelect_State
Access Type Syntax
Read Access: Get MultiSelect_State to BooleanVariable
Write Access: Set MultiSelect_State to BooleanVariable/Value

Description

The MultiSelect_State property determines whether users can select more than one file while the dialog is open. When True, the Selected_Files property will contain the list of selected files (full path). The File_Name property will contain the path to each of these files.

Default is False.

Sample

This sample shows how to retrieve multiple user-selected files from an OpenDialog.

Use dfAllEnt.pkg
Use File_Dlg.pkg

Object oPanel is A Panel
    Set Size     To 50 175
    Set Location To 25 12
    Set Label    To 'Open Dialog Example'

    Object oOpenDialog1 is an OpenDialog
        Set Filter_String to 'Text|*.txt'
        Set Initial_Folder to 'C:\DataFlex 19.1'
    End_Object

    Object oOpenButton1 is a Button
        Set Location To  10 10
        Set Label    To 'Open...'

        Procedure OnClick
            Boolean bOpen bReadOnly
            String sFileTitle
            String[] sSelectedFiles

            Get Show_Dialog of oOpenDialog1 to bOpen
            If bOpen Begin
                Get TickReadOnly_State of oOpenDialog1 to bReadOnly
                Get File_Title of oOpenDialog1 to sFileTitle
                Get Selected_Files of oOpenDialog1 to sSelectedFiles
                Move sSelectedFiles[0] to sFileName

                // loop through array of selected files and display file names
                For i from 0 to (SizeOfArray(sSelectedFiles)-1)
                    Showln ("File Name=" + sSelectedFiles[0])
                Loop
            End
            Else ;
                Send Info_Box "You did NOT choose a file"
        End_Procedure

    End_Object

End_Object

Start_UI