VB Code:
Private strLines() As String
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Lets Load the lines from the file and store them in a globally
Dim sr As New IO.StreamReader("..\File.txt")
strLines = Split(sr.ReadToEnd, vbCrLf)
sr.Close()
sr = Nothing
'Done Reading File ;)
End Sub
Private Sub MyTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyTimer.Tick
Static intCurrentIndex As Integer
lblLine.Text = strLines(intCurrentIndex)
If intCurrentIndex = strLines.Length - 1 Then
'Reset
intCurrentIndex = 0
Else
intCurrentIndex += 1
End If
End Sub
Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click
MyTimer.Start()
End Sub
Private Sub btnStop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStop.Click
MyTimer.Stop()
End Sub