I have a textbox with ABCDEFGHT on one side and a listbox that is reading a textfile with two column(first column = student name, second column = ABCDEGFYT). I would like to compare (the second column to the textbox content and have the result appear as a third column in the same listbox. I hope this time it's clear. thanks in advance. The language is VISUAL STUDIO.
If rbtCPC.Checked = True Then
answerkey = IO.File.ReadAllLines("answerkey.txt") ' read stanswers.txt into stanswers array
Else
answerkey = IO.File.ReadAllLines("answerkey2.txt") ' read stanswers.txt into stanswers array
End If
txtanswer.Text = answerkey(0)
End Sub
Private Sub rbtCP2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rbtCP2.CheckedChanged
If rbtCP2.Checked = True Then
lstGrades.Items.Clear()
Else
rbtCPC.Checked = True
lstGrades.Items.Clear()
End If
End Sub
Dim Result As IO.StreamReader
Private Sub btnDisplay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplay.Click
If rbtCPC.Checked = True Then
Result = New IO.StreamReader("stanswers.txt")
Else
Result = New IO.StreamReader("stanswers2.txt")
End If
lstGrades.Items.Clear()
While (Result.Peek() > -1)
lstGrades.Items.Add(Result.ReadLine)
End While
Result.Close()
If rbtCPC.Checked = True Then
answerkey = IO.File.ReadAllLines("answerkey.txt") ' read stanswers.txt into stanswers array
Else
answerkey = IO.File.ReadAllLines("answerkey2.txt") ' read stanswers.txt into stanswers array
End If
txtanswer.Text = answerkey(0)
End Sub
Private Sub rbtCP2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rbtCP2.CheckedChanged
If rbtCP2.Checked = True Then
lstGrades.Items.Clear()
Else
rbtCPC.Checked = True
lstGrades.Items.Clear()
End If
End Sub
Dim Result As IO.StreamReader
Private Sub btnDisplay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplay.Click
If rbtCPC.Checked = True Then
Result = New IO.StreamReader("stanswers.txt")
Else
Result = New IO.StreamReader("stanswers2.txt")
End If
lstGrades.Items.Clear()
While (Result.Peek() > -1)
lstGrades.Items.Add(Result.ReadLine)
End While
Result.Close()