Hi i am trying to delete a file(s) from a checked list box, when i click a button. This is the code i have:
Dim item As IO.FileInfo For Each item In CheckedListBox1.CheckedItems Try item.Delete() Catch : End Try Next item
But i get the error: Unable to cast object of type 'System.String' to type 'System.IO.FileInfo'.
Am i doing something really stupid lol, any help would be appreciated