Stream Reader and Combo Boxes
-
:confused:I am stuck on a project. I have a .txt file with 8 separate lists in it. Each list is separated by a "#" sign. I need to use StreamReader to read each individual list from the file and transfer each list into a separate combo box for user selection. I can read the file but I am having trouble passing each line of a list into the combo box. Basically I only get the last line. My Code is as follows: Dim SongStreamReader As IO.StreamReader Dim Record As String If IO.File.Exists("Country.txt") Then SongStreamReader = IO.File.OpenText("Country.txt") Do Until SongStreamReader.Peek() = -1 Record = SongStreamReader.ReadLine() Me.uiList1Combo.Text = Record Loop SongStreamReader.Close() Else MessageBox.Show("File Does not exist", "Country", MessageBoxButtons.OK, MessageBoxIcon.Information) End If End Sub Any Suggestions?
-
:confused:I am stuck on a project. I have a .txt file with 8 separate lists in it. Each list is separated by a "#" sign. I need to use StreamReader to read each individual list from the file and transfer each list into a separate combo box for user selection. I can read the file but I am having trouble passing each line of a list into the combo box. Basically I only get the last line. My Code is as follows: Dim SongStreamReader As IO.StreamReader Dim Record As String If IO.File.Exists("Country.txt") Then SongStreamReader = IO.File.OpenText("Country.txt") Do Until SongStreamReader.Peek() = -1 Record = SongStreamReader.ReadLine() Me.uiList1Combo.Text = Record Loop SongStreamReader.Close() Else MessageBox.Show("File Does not exist", "Country", MessageBoxButtons.OK, MessageBoxIcon.Information) End If End Sub Any Suggestions?