Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim name As String
Dim i As Integer
Dim grosspay As Double
Dim fin As IO.StreamReader = IO.File.OpenText("employees.txt")
For i = 1 To 5
name = fin.ReadLine
grosspay = fin.ReadLine
If name = TextBox1.Text Then
TextBox2.Text = FormatCurrency(grosspay)
End If
Next
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
TextBox1.Text = ""
TextBox2.Text = ""
End Sub
End Class