'3 tane text box yapın
'1 tane label yapın
' 1 tane timer yapın
'4 tane command button yapın kodu pasteleyin.
Dim Hours As Integer
Dim Minutes As Integer
Dim Seconds As Integer
Dim Time As Date
Private Sub Mydisplay()
'mydisplay programın can damarı
Hours = Val(Text1.Text)
Minutes = Val(Text2.Text)
Seconds = Val(Text3.Text)
Time = TimeSerial(Hours, Minutes, Seconds)
Label1.Caption = Format$(Time, "hh") & ":" & Format$(Time, "nn") & ":" & Format$(Time, "ss")
End Sub
Private Sub Command1_Click()
Timer1.Enabled = True
Command3.Enabled = False
End Sub
Private Sub Command2_Click()
Timer1.Enabled = False
Command3.Enabled = True
End Sub
Private Sub Command3_Click()
Hours = 0
Minutes = 0
Seconds = 0
Time = 0
Text1.Text = " "
Text2.Text = " "
Text3.Text = " "
Text1.SetFocus
End Sub
Private Sub Command4_Click()
End
End Sub
Private Sub Form_Load()
'Formu ortalamak için
Form1.Top = (Screen.Height - Form1.Height) / 2
Form1.Left = (Screen.Width - Form1.Width) / 2
'Timer'ın intervalı
Timer1.Interval = 1000
Hours = 0
Minutes = 0
Seconds = 0
Time = 0
End Sub
Private Sub Text1_Change()
Mydisplay
End Sub
Private Sub Text2_Change()
Mydisplay
End Sub
Private Sub Text3_Change()
Mydisplay
End Sub
Private Sub Timer1_Timer()
Timer1.Enabled = False
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.Visible = True
Timer1.Enabled = True
Else
Timer1.Enabled = False
Beep
Beep
Command3.Enabled = True
End If
End Sub