Dim filelist As New List(Of String)
Private Sub AddFile(ByVal Item As String)
Dim F As New FileInfo(Item)
CheckedListBox1.Items.Add(F.Name)
filelist.Add(F.FullName)
End Sub
Private Sub RemoveFile(ByVal Index As Integer)
File.Delete(filelist.Item(Index))
CheckedListBox1.Items.RemoveAt(Index)
filelist.RemoveAt(Index)
End Sub
Private Sub FillList(ByVal Path As String)
Me.CheckedListBox1.Items.Clear()
filelist = New List(Of String)
For Each filepath As String In Directory.GetFiles(Path, "*.*", SearchOption.AllDirectories)
AddFile(filepath)
Next
End Sub
Private Sub DeleteSelectedIndices()
For Each i As Integer In CheckedListBox1.SelectedIndices
RemoveFile(i)
Next
End Sub
Be sure to Import File.IO
Imports File.IO
(above the class)