How can I delete an (selected) item from a listbox ?
I have a listbox, filled with file-names, I select one of the items and with a commandbutton I will delete (kill or move) this file. What do I have to do ??
Regards, K. Lensen
Printable View
How can I delete an (selected) item from a listbox ?
I have a listbox, filled with file-names, I select one of the items and with a commandbutton I will delete (kill or move) this file. What do I have to do ??
Regards, K. Lensen
I'm not sure if you are talking about a listbox or a filelistbox.
But for a listbox it's simple:
listbox.removeitem listbox.listindex
For a filelistbox:
Kill listbox.path & listbox.filename
listbox.refresh
What Type Of List Box Are You Using To Display The Files;
A List Box, Or File List Box.
For a filelist box use this:
Private Sub Command1_Click()
Kill File1.Path & File1.List(File1.ListIndex)
File1.Refresh
End Sub
Mark
Good Luck!!