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
[1]: /answers/storage/attachments/195346-capture-20220421-232836.png