VERSION 5.00
Begin VB.Form frmTimer 
   Caption         =   "Form1"
   ClientHeight    =   3090
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3090
   ScaleWidth      =   4680
   StartUpPosition =   3  'Windows Default
   Begin VB.Timer Timer1 
      Left            =   1440
      Top             =   2400
   End
   Begin VB.TextBox txtMinutes 
      Height          =   285
      Left            =   720
      TabIndex        =   2
      Text            =   "8"
      Top             =   840
      Width           =   615
   End
   Begin VB.CommandButton cmdStop 
      Caption         =   "Command2"
      Height          =   375
      Left            =   2160
      TabIndex        =   1
      Top             =   1320
      Width           =   1095
   End
   Begin VB.CommandButton cmdRun 
      Caption         =   "Command1"
      Height          =   375
      Left            =   600
      TabIndex        =   0
      Top             =   1320
      Width           =   1095
   End
   Begin VB.Label lblCountDown 
      Caption         =   "Label1"
      Height          =   255
      Left            =   1920
      TabIndex        =   3
      Top             =   840
      Width           =   1695
   End
End
Attribute VB_Name = "frmTimer"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim strTime() As String
Dim dteTarget As Date

Private Sub cmdRun_Click()
    Select Case cmdRun.Caption
        Case "Start"
            cmdRun.Caption = "Pause"
            cmdStop.Enabled = True
            dteTarget = DateAdd("n", Val(txtMinutes.Text), Now)
            Timer1.Enabled = True
            lblCountDown.Caption = txtMinutes.Text & " 00"
        Case "Pause"
            cmdRun.Caption = "Resume"
            strTime = Split(lblCountDown.Caption, " ")
            Timer1.Enabled = False
        Case "Resume"
            cmdRun.Caption = "Pause"
            dteTarget = DateAdd("n", Val(strTime(0)), Now)
            dteTarget = DateAdd("s", Val(strTime(1)), dteTarget)
            Timer1.Enabled = True
    End Select
End Sub

Private Sub cmdStop_Click()
    cmdStop.Enabled = False
    cmdRun.Caption = "Start"
    Timer1.Enabled = False
End Sub

Private Sub Form_Load()
    cmdRun.Caption = "Start"
    cmdStop.Caption = "Stop"
    cmdStop.Enabled = False
    Timer1.Interval = 1000
    Timer1.Enabled = False
End Sub

Private Sub Timer1_Timer()
    lblCountDown.Caption = Format((dteTarget - Now), "n ss")
    
    If lblCountDown.Caption = "0 00" Then
        cmdStop_Click
    End If

End Sub
