'Private strIDNumbers As ArrayList() (What is this for??)
Private intRecordcount As Integer = 0
[b]Private names as New ArrayList()[/b]
Private Sub OpenFileButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenFileButton.Click
'determine if customers.txt exists
If System.IO.File.Exists("customers.txt") = True Then
'make the property labels visible
Me.IDNumberLabel.Visible = True
Me.NameLabel.Visible = True
Me.CreditLimitLabel.Visible = True
Me.BalanceDueLabel.Visible = True
'open the text file
Dim objStreamReader As System.IO.StreamReader
Dim strLine As String
objStreamReader = System.IO.File.OpenText("customers.txt")
Do While objStreamReader.Read
strLine = objStreamReader.ReadLine
[b] names.Add(strline)[/b]
Dim strID As String, intLength As Integer
intLength = Val(strLine.Length)
strID = strLine.Remove(3, (intLength - 3))
Me.IDListBox.Items.Add(strID)
intRecordcount = intRecordcount + 1
Loop
Me.OpenFileButton.Enabled = False
'customers.txt does not exist, stop
Else
MessageBox.Show("File does not exist!", "File not found", _
MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
End If
End Sub