Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selecting Multiple Win10 Image Files

Status
Not open for further replies.

Patrick Allen

Programmer
Jan 25, 2019
7
0
0
US
Hello. I currently have an app which allows the user to select an image file from the MS file system ... then I store the filename and a link to the file in the app database.

I am using Delphi 6 (BDS2006) and would like to know how I can detect if several image files are selected from the MS file system and process the multiple file selections in order to enter the filename and like for all selected files into the app database.

Thanks in Advance,

Patrick (Delphi user since the Polaris Beta version of Delphi.
 
What are you using to select the image files currently? What have you tried? If you are using the standard Open dialogs, you should be able to set MultiSelect to on and then get the list of files selected.

Mirtheil
 
Mirtheil,

Hello. Yes, I am using the OpenDlg file system popup dialog box to select the desired file. To improve the app, I need to allow the user(s) to select multiple files at one time.

Patrick
 
Mirtheil,

After posting the above reply, I opened the app and clicked on the "select file" option in the app. When the dialog displayed, it showed the list of available files, but I did not see a MultiSelect option.

Is the solution a variation of for x := 0 the selected - 1 do? ... and in the loop capture the file name and location for storing in the database?

Thanks, Patrick
 
The MultiSelect option is in Options and is called 'ofAllowMultiSelect'. Here's a very simple example that displays the OpenDialog, allows multiple selection of files and then adds the list of files to a Memo. The Files object of the OpenDialog is a StringList and can be treated as such.

Example:
Code:
  with OpenDialog1 do begin
    Options := [ofALlowMultiSelect];
    if (Execute()) then begin
      Memo1.Lines := Files;
    end;
  end;

This code works in both Delphi 5 and Delphi 10.3 (only versions I have access to).

Mirtheil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top