Please, I am intending to delete Listbox item i.e. delete selected item from both folder and Listbox. Implementing the following code, the file was deleted accordingly, but i got a conflicting error with a previous line of code, which terminated the application. Please, see attachment to view error. Thank you.
If ListBox1.SelectedIndex <> -1 Then System.IO.File.Delete(ListBox1.Items(ListBox1.SelectedIndex).fullname()) ListBox1.Items.RemoveAt(ListBox1.SelectedIndex) End If