Basit bir kronometre yaptık.
Eklenecekler:
3 textbox
3 label
4 button
1 groupbox
Kronometre yapımı VB.NET |
Görseldeki gibi de yapabilirsiniz.
Public Class Form1 Dim saniye, dakika, saat As Integer Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick 'visualbasicdersleri.com saniye = saniye + 1 If saniye = 60 Then dakika = dakika + 1 saniye = 0 End If If dakika = 60 Then saat = saat + 1 dakika = 0 End If If saat = 24 Then saat = 0 TextBox1.Text = saniye TextBox2.Text = dakika TextBox3.Text = saat End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load TextBox1.Text = 0 'visualbasicdersleri.com TextBox2.Text = 0 TextBox3.Text = 0 End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Timer1.Enabled = False End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Timer1.Enabled = True End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click saat = TextBox3.Text dakika = TextBox2.Text saniye = TextBox1.Text End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click TextBox1.Text = 0 TextBox2.Text = 0 TextBox3.Text = 0 End Sub 'visualbasicdersleri.com End Class