hi to all
I have a listbox with more than 100 *.txt files in the following directory:
C:\Users\MyName\AppData\Roaming\Booking\textfiles
text file names will be random and unknown
=========================================
=========================================
checked Options in listbox properties:
"Checklist"
"Multiple selection"
"Sort"
"Vertical scrollbar"
the "Item text" i left blank
the "item Data" i numbered from 1 to 300 (just in case)
So if i'll check some text file from listbox
By using button i would like to delete selected text file from my directory as well as from listbox.
I know how to delete from listbox by using "ListBox.DeleteItem"
But can't delete that file from directory in the same time
Please helm me how to do.
I have a listbox with more than 100 *.txt files in the following directory:
C:\Users\MyName\AppData\Roaming\Booking\textfiles
text file names will be random and unknown
=========================================
Code:
--add to listbox-- text = Shell.GetFolder(26); files = File.Find(text.."\\Booking\\textfiles", "*.*", false, false, nil); if files ~= nil then min = 1; max = Table.Count(files); ListBox.DeleteItem("ListBox1", LB_ALLITEMS) for count = min, max do split = String.SplitPath(files[count]); result = ListBox.AddItem("ListBox1", split.Filename..split.Extension, files[count]); end else Dialog.Message("WARNING", "Files not found!"); ListBox.SetEnabled("ListBox1", false); end
checked Options in listbox properties:
"Checklist"
"Multiple selection"
"Sort"
"Vertical scrollbar"
the "Item text" i left blank
the "item Data" i numbered from 1 to 300 (just in case)
So if i'll check some text file from listbox
By using button i would like to delete selected text file from my directory as well as from listbox.
I know how to delete from listbox by using "ListBox.DeleteItem"
But can't delete that file from directory in the same time
Please helm me how to do.
Comment