Click here to Skip to main content
15,921,577 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can we load two files into a listbox at the same time?
Posted

write a subrountine that

1. opens the file
2. reads the contents and add it to the listbox line by line

You can either add the row contents direct to the listbox using

dim ReadLineFromFile as string = file.readline
listbox1.items.add(ReadLineFromFile)


or you can create either a datatable / generic list to store the details in from all the files and then add it to the the listbox1's datasource

3. close the file

and repeat for the remaining files that you want to import.

Read file example[^]
 
Share this answer
 
That depends entirely on what you mean by "load two files in a listbox".

Are you saying that you want one file appended to the end of the other in the listbox? Are you asking if you can merge each line from both files together (line 1 from this file is appended to line 1 of the 2nd file)?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900