VERSION 5.00 Begin VB.Form Form1 Caption = "Form1" ClientHeight = 3930 ClientLeft = 120 ClientTop = 465 ClientWidth = 9525 LinkTopic = "Form1" ScaleHeight = 3930 ScaleWidth = 9525 StartUpPosition = 3 'Windows-Standard Begin VB.CommandButton Command5 Caption = "Command5" Height = 495 Left = 7080 TabIndex = 13 Top = 3120 Width = 1695 End Begin VB.TextBox Text4 Height = 1815 Left = 6720 TabIndex = 12 Text = "Text4" Top = 600 Width = 2535 End Begin VB.Timer Timer1 Left = 840 Top = 3120 End Begin VB.TextBox Text3 Height = 495 Left = 2760 TabIndex = 6 Text = "Text3" Top = 240 Width = 1095 End Begin VB.TextBox Text2 Height = 495 Left = 1560 TabIndex = 5 Text = "Text2" Top = 240 Width = 1095 End Begin VB.TextBox Text1 Height = 495 Left = 360 TabIndex = 4 Text = "Text1" Top = 240 Width = 1095 End Begin VB.CommandButton Command4 Caption = "Ende" Height = 495 Left = 4800 TabIndex = 3 Top = 2520 Width = 1095 End Begin VB.CommandButton Command3 Caption = "Reset" Height = 495 Left = 3480 TabIndex = 2 Top = 2520 Width = 1095 End Begin VB.CommandButton Command2 Caption = "Pause" Height = 495 Left = 2160 TabIndex = 1 Top = 2520 Width = 1095 End Begin VB.CommandButton Command1 Caption = "Start" Height = 495 Left = 840 TabIndex = 0 Top = 2520 Width = 1095 End Begin VB.Label Label5 Caption = "10" BeginProperty Font Name = "Verdana" Size = 26.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 615 Left = 5040 TabIndex = 11 Top = 1680 Width = 855 End Begin VB.Label Label4 Caption = "von" BeginProperty Font Name = "Verdana" Size = 26.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 615 Left = 3720 TabIndex = 10 Top = 1680 Width = 975 End Begin VB.Label Label3 Caption = "1" BeginProperty Font Name = "Verdana" Size = 26.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 615 Left = 2760 TabIndex = 9 Top = 1680 Width = 735 End Begin VB.Label Label2 Caption = "Runde " BeginProperty Font Name = "Verdana" Size = 26.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 615 Left = 720 TabIndex = 8 Top = 1680 Width = 1815 End Begin VB.Label Label1 Alignment = 2 'Zentriert Caption = "Label1" BeginProperty Font Name = "Verdana" Size = 26.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 615 Left = 1320 TabIndex = 7 Top = 840 Width = 3735 End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Dim Hours As Integer Dim Minutes As Integer Dim Seconds As Integer Dim Time As Date Dim Runde As Integer Private Sub Mydisplay() 'This code is common to all three text boxes so I 'put it in it's own sub. 'Extract the numbers from the text boxes by using 'the Val() statement. Hours = Val(Text1.Text) Minutes = Val(Text2.Text) Seconds = Val(Text3.Text) 'Convert variables to time format Time = TimeSerial(Hours, Minutes, Seconds) 'Display the converted time variable in label 1 'Label1.Caption = Format$(Time, "hh") & ":" & Format$(Time, "nn") & ":" & Format$(Time, "ss") Label1.Caption = Format$(Time, "nn") & ":" & Format$(Time, "ss") End Sub Private Sub Command1_Click() 'Start button - turn on timer and disable reset 'button Timer1.Enabled = True Command3.Enabled = False End Sub Private Sub Command2_Click() 'Pause button - temporarily stop timer and enable 'reset button. You can restart countdown by clicking 'the start button. Or reset the time by clicking 'the reset button. Timer1.Enabled = False Command3.Enabled = True End Sub Private Sub Command3_Click() 'Reset button - reset all varibles and text boxes 'to nothting. Cls Hours = 0 Minutes = 0 Seconds = 0 Time = 0 Text1.Text = "00" Text2.Text = "00" Text3.Text = "05" Timer1.Enabled = False End Sub Private Sub Command4_Click() 'Exit button - end program and clear varibles End End Sub Private Sub Command5_Click() For x = 1 To 10 Text4.Text = Text4.Text & x Next x End Sub Private Sub Form_Load() 'Center form on screen. ' Form1.Top = (Screen.Height - Form1.Height) / 2 ' Form1.Left = (Screen.Width - Form1.Width) / 2 'Set timer interval and varibles Timer1.Interval = 1000 Hours = 0 Minutes = 0 Seconds = 0 Time = 0 Runde = 1 Text1.Text = "00" Text2.Text = "00" Text3.Text = "45" Text4.Text = "" Timer1.Enabled = False Label3.Caption = Runde End Sub Private Sub Text1_Change() 'Call Mydisplay sub to display text box data Mydisplay End Sub Private Sub Text2_Change() 'Call Mydisplay sub to display text box data Mydisplay End Sub Private Sub Text3_Change() 'Call Mydisplay sub to display text box data Mydisplay End Sub Private Sub Timer1_Timer() 'Count down loop 'For x = 1 To 10 Timer1.Enabled = False 'Text3.Text = "05" If (Format$(Time, "hh") & ":" & Format$(Time, "nn") & ":" & Format$(Time, "ss")) <> "00:00:00" Then 'Counter to continue loop until 0 Time = DateAdd("s", -1, Time) Label1.Visible = False ' Label1.Caption = Format$(Time, "hh") & ":" & Format$(Time, "nn") & ":" & Format$(Time, "ss") Label1.Caption = Format$(Time, "nn") & ":" & Format$(Time, "ss") Label1.Visible = True Timer1.Enabled = True Else 'Turn off timer, set off alarm, and enable reset. Text3.Text = "15" Timer1.Enabled = False Beep Beep Timer1.Enabled = True 'Command3.Enabled = True End If 'Next x End Sub