Hi Guys,
I am working on a project, and would like to be able to import text files into a listbox. So that one line in the text files makes one item in the list box, I have successfully been able to make it export from listbox to text file in that format. I would also like to import using a file dialog if possible. My export code is below if it helps. Any advice is appreciated!
I can't seem to get a similar method with OpenFileDialogs and StreamReaders to work.
Thanks,
Ryan
I am working on a project, and would like to be able to import text files into a listbox. So that one line in the text files makes one item in the list box, I have successfully been able to make it export from listbox to text file in that format. I would also like to import using a file dialog if possible. My export code is below if it helps. Any advice is appreciated!
Code:
Dim ObjWriter As New IO.StreamWriter(SaveFileDialog1.FileName)
For i = 0 To listItems.Items.Count - 1
ObjWriter.WriteLine(listItems.Items.Item(i))
Next
ObjWriter.Close()
Thanks,
Ryan