Ok, well I now have the following code which takes the first three characters in each line of a text file and puts then in an idlistbox. I now need to code the procedure that parses each line and displays the comma separated values in labels.

Here is my code so far...

VB Code:
  1. Private intRecordcount As Integer = 0
  2.     Private Names As New ArrayList()
  3.  
  4.     Private Sub OpenFileButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenFileButton.Click
  5.         'determine if customers.txt exists
  6.         If System.IO.File.Exists("customers.txt") = True Then
  7.             'make the property labels visible
  8.             Me.IDNumberLabel.Visible = True
  9.             Me.NameLabel.Visible = True
  10.             Me.CreditLimitLabel.Visible = True
  11.             Me.BalanceDueLabel.Visible = True
  12.             'open the text file
  13.             Dim objStreamReader As System.IO.StreamReader
  14.             Dim strLine As String
  15.             objStreamReader = System.IO.File.OpenText("customers.txt")
  16.             Do Until objStreamReader.Peek = -1
  17.                 strLine = objStreamReader.ReadLine()
  18.                 Names.Add(strLine)
  19.                 Dim strID As String, intLength As Integer
  20.                 intLength = Val(strLine.Length)
  21.                 strID = strLine.Remove(3, intLength - 3)
  22.                 Me.IDListBox.Items.Add(strID)
  23.                 intRecordcount = intRecordcount + 1
  24.             Loop
  25.             Me.OpenFileButton.Enabled = False
  26.             'customers.txt does not exist, stop
  27.         Else
  28.             MessageBox.Show("File does not exist!", "File not found", _
  29.             MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
  30.         End If
  31.     End Sub
  32.  
  33.  
  34.     Private Sub SelectedValueChanged_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles IDListBox.Click
  35.  
  36.     End Sub