I am adding files to a ComboBox like so:
For Each fReports As FileInfo In dirReports.GetFiles
I need to be able to list the contents of the appropriate file when the user selects an item. The listing part I already have figured out. What I need to know is how to loop through the items and then commit then action on that file.
I tried this:
For Each item As FileInfo In tscboxReports.SelectedItem
I also tried it as an Object, but it still did not work.
This is the error I've received:
Unable to cast object of type 'System.IO.FileInfo' to type 'System.Collections.IEnumerable'.
The error is the same no matter if I loop through them as 'Objects' or 'FileInfos'.