Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2002
    Location
    france
    Posts
    94

    how to add multiple selected files to a listbox ?

    hello

    i managed to add a single file to a listbox using the following code, but even if i set "multiple selection" to true, when i select multiples files only the last one is added

    Code:
    01 MesDoc = Shell.GetFolder(SHF_MYDOCUMENTS); 
    02 ajout_fichier = Dialog.FileBrowse(true, "Ajouter 1 Fichier ...", MesDoc, "Images (*.jpg,*.png,*.gif,*.png,*.tif)|*.jpg;*.png;*.gif;*.png;*.tif|", "", "", true, true); 
    03 if (ajout_fichier[1] ~= "CANCEL") then 
    04 -- enlever le chemin
    05 fichier = String.SplitPath(ajout_fichier[1]); 
    06 -- Ajouter à la liste
    07 ListBox.AddItem( "ListBox1", fichier.Filename..fichier.Extension, ajout_fichier[1]); 
    08 end
    output enhanced with AMS Code Pretty


    can you help me ?

    claude

  2. #2
    Join Date
    May 2006
    Posts
    5,380
    you need to loop through the files and add them to the listbox

    try this

    Code:
    MesDoc = Shell.GetFolder(SHF_MYDOCUMENTS); 
    ajout_fichier = Dialog.FileBrowse(true, "Ajouter 1 Fichier ...", MesDoc, "Images (*.jpg,*.png,*.gif,*.png,*.tif)|*.jpg;*.png;*.gif;*.png;*.tif|", "", "", true, true); 
    if (ajout_fichier[1] ~= "CANCEL") then 
    	for i,v in ajout_fichier do 
    	 	-- enlever le chemin
    		fichier = String.SplitPath(ajout_fichier[i]); 
    	 	-- Ajouter à la liste
    		ListBox.AddItem( "ListBox1", fichier.Filename..fichier.Extension, ajout_fichier[i]); 
    	end 
    end
    output enhanced with AMS Code Pretty
    Open your eyes to Narcissism, Don't let her destroy your life!!

Similar Threads

  1. Playing Multiple Audio Files in Sequence
    By Desmond in forum AutoPlay Media Studio 5.0 Examples
    Replies: 6
    Last Post: 08-15-2005, 03:38 PM
  2. Playing Multiple Video Files in Sequence
    By Desmond in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 09-26-2003, 11:10 AM
  3. Replies: 2
    Last Post: 01-13-2003, 01:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts