Question Files in Listbox

DaFallenAngel

New member
Joined
Apr 16, 2009
Messages
2
Programming Experience
3-5
Hello everyone

I am creating a little form that shows files (on my computer) in a listbox and well i am wanting to be able to click on one of these files in the listbox and hit the delete button and delete it off the listbox and off my computer how can i do this?

Thank You
DaFallenAngel
 
Is this in any way having to do with this thread [ame=http://www.vbforums.com/showthread.php?t=565919]VS 2008 Files in Listbox - VBForums[/ame] on a different forum?

If so, you're not going to be able to just delete a file like that if the extensions are taken off when stored in the list, you'd need to create a way to store both, the full file path and name plus just the name which is shown in the listbox.

I'm only asking to be sure I (and anyone else) gives you better advice.
 
Well its just going to be one kind of extention which is .txt so isn't there a way to like say

"c:\" & sFiles & ".txt" something like that?

or a way to store the full path and file and extention in like a variable
 
Jmc's on top of it: [ame=http://www.vbforums.com/showpost.php?p=3496969&postcount=6]VBForums - View Single Post - VS 2008 Files in Listbox[/ame]

Use the SelectedValue, for the full path when deleting the file. You can use IO.File.Delete() or My.Computer.FileSystem.DeleteFile()
 
Back
Top