- Joined
- May 18, 2007
- Messages
- 1,789
- Reaction score
- 291
I have a problem with the below. It keeps looping, I know why, but what I don't know is why it's not inserting the info into the listbox. It doesn't throw any errors either. Everything is set from Private to Public, no effect. I had this problem before but I can't remember how I fixed it for the life of me. Even then, it was in C#.
Code:
Public Function LoadItemLibrary(ByVal path As String)
Try
Dim ItemReader As StreamReader = New StreamReader(path)
AceTool.ItemList.Items.Clear()
Do
Loops here ---> AceTool.ItemList.Items.Add(ItemReader.ReadLine)
Loops here ---> AceTool.ListBox1.Items.Add(ItemReader.ReadLine)
Loop Until ItemReader.Peek = -1
Catch ex As Exception
MessageBox.Show(ex.ToString)
If AceTool.ItemList.Items.Count > 0 Then
AceTool.ItemList.Enabled = True
Else
AceTool.ItemList.Items.Add("Error reading library")
End If
End Try
End Function