Hi, Im making a file manager app, but I have added a delete button, how do I make it delete the selected file(s)?
Screenshot:![]()
Professional Software Development Tools
Hi, Im making a file manager app, but I have added a delete button, how do I make it delete the selected file(s)?
Screenshot:![]()
here is a function that will delete all the selected files in a listbox
output enhanced with AMS Code PrettyCode:-- place this function in global functions function DeleteFilesFromListbox(LB) sProceed = Dialog.Message( "Notice", "Are You Sure.", MB_YESNO, MB_ICONNONE, MB_DEFBUTTON1); if sProceed == IDYES then tSelected = ListBox.GetSelected(LB); if tSelected then StatusDlg.Show(); for i,v in tSelected do strlocation = ListBox.GetItemData(LB, tSelected[1]) File.Delete(strlocation, false, false, false, nil); ListBox.DeleteItem(LB, tSelected[1]); error = Application.GetLastError(); end StatusDlg.Hide(); if (error ~= 0) then Dialog.Message( "Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION); end end end end -- example of function call DeleteFilesFromListbox( "ListBox1")
Open your eyes to Narcissism, Don't let her destroy your life!!
Thanks RizlaUK but it aint a listbox Im usingf, im using a web object to display files and folders.
So for instance, when i click on the pic of the floppy disc, it displays the contents of the floppy in the white space below(Web1), I click on the pic of the CD & the Web updates to show the contents of that drive etc...
OK, call it a Windows Explorer alternative, but wanna delete the files, cos normally in windows, i select the file & press the delete key to delete the file, hope this has made things clearer for people hehe![]()
ermm, ok,
i take it you are using a web object to get a thumbnail view of the files/folders,
im sure it can be done, but i haven't got the time tonight to mess about with it
if no one chimes in ill see what i can come up with tomorrow
Open your eyes to Narcissism, Don't let her destroy your life!!
Thanks!
And I hope that some other people can "chime in" to provide alternate ways!
Thanks so much for your help so far!![]()