Public Class Form1
Const hr = 3600
Dim i As Integer = 0
Friend WithEvents Timer1 As System.Windows.Forms.Timer = New Windows.Forms.Timer()
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Timer1.Interval = 1000 '(1s)
Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Me.Text = "เหลือเวลา " & hr - i & " s"
If i >= hr Then
MessageBox.Show("Program Close")
Close()
End If
i = i + 1
End Sub
End Class