Option Explicit
Private Sub Form_Load()
Timer1.Interval = 500
Timer1.Enabled = True
End Sub
Private Sub Form_Resize()
If WindowState <> vbMinimized Then
'Text1 is a multiline TextBox:
Text1.Move 0, 0, ScaleWidth, ScaleHeight
End If
End Sub
Private Sub Timer1_Timer()
Dim F As Integer
Dim I As Long
F = FreeFile(0)
On Error Resume Next
Open "file.txt" For Input As #F
If Err Then
Text1.SelStart = &H7FFF
Text1.SelText = "Poll" & vbNewLine
Else
On Error GoTo 0
Timer1.Enabled = False
Do Until EOF(F)
Input #F, I
Text1.SelStart = &H7FFF
Text1.SelText = CStr(I) & vbNewLine
Loop
Close #F
Text1.SelStart = &H7FFF
Text1.SelText = "Complete"
End If
End Sub