Hi.
How can I populate a ListView with a CSV file? My CSV file is like this:
John,Image1.bmp
Kenny,Image2.bmp
Jimmy,Image3.bmp
The first value is the Text of the item. The second value is the image's name.
I made this code to loop through the CSV File, but I don't know how to insert the image into the item.
Now that I have the values, how can I create a new ListView Item with the text and the image from that values?
Also, I'm using a ListView with LargeIcons.
How can I populate a ListView with a CSV file? My CSV file is like this:
John,Image1.bmp
Kenny,Image2.bmp
Jimmy,Image3.bmp
The first value is the Text of the item. The second value is the image's name.
I made this code to loop through the CSV File, but I don't know how to insert the image into the item.
Code:
Dim Items() As String.
Dim Lines() As String = IO.File.ReadAllLines(Path.Combine(Application.StartupPath, "TestCSV.txt"))
For Each Line As String In Lines
' CSV(0) = Text
' CSV(1) = Image Location
CSV = Line.Split(",")
Dim bm As New Bitmap(Path.Combine(Application.StartupPath, "Images\" & Items(1)))
Next
Also, I'm using a ListView with LargeIcons.