I have to agree. You can't "clear" a FileListBox. If you want to just remove a selected filename each time the cmdCheck is clicked then you can do as XRsTX suggested.
Copy the filelist to a listbox and use List1.RemoveItem (List1.ListIndex)
Here's an example using command1 , file1 and list1
If clicking on the commandbutton is deleting or moving the file then use file1.Refresh to update the filelist.VB Code:
Private Sub Form_Load() Dim i As Integer For i = 0 To File1.ListCount - 1 List1.AddItem File1.List(i) Next i End Sub Private Sub Command1_Click() If List1.ListIndex = -1 Then Exit Sub List1.RemoveItem (List1.ListIndex) End Sub




Reply With Quote