TIMER DALAM VB.NET 2008
haii sahabat blogger
neh ada sedikit progra timer dengan menggunakan vb.net 2008
semoga bermanfaat bagi kita semua
Public Class STOPWATCH
Private Sub Label3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label3.Click
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
MILIDETIK.Text = Val(MILIDETIK.Text) + 1
If Microsoft.VisualBasic.Len(MILIDETIK.Text) = 1 Then
MILIDETIK.Text = "0" & MILIDETIK.Text
End If
If MILIDETIK.Text = "60" Then
MILIDETIK.Text = "00"
DETIK.Text = Val(DETIK.Text) + 1
If Microsoft.VisualBasic.Len(DETIK.Text) = 1 Then
DETIK.Text = "0" & DETIK.Text
End If
If DETIK.Text = "60" Then
DETIK.Text = "00"
MENIT.Text = Val(MENIT.Text) + 1
If Microsoft.VisualBasic.Len(MENIT.Text) = 1 Then
End If
If MENIT.Text = "60" Then
MENIT.Text = "00"
JAM.Text = Val(JAM.Text) + 1
If Microsoft.VisualBasic.Len(JAM.Text) = 1 Then
JAM.TabIndex = "0" & JAM.Text
End If
End If
End If
End If
End Sub
Private Sub BTN_START_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTN_START.Click
JAM.Text = "00"
MENIT.Text = "00"
DETIK.Text = "00"
MILIDETIK.Text = "00"
Timer1.Start()
End Sub
Private Sub BTN_STOP_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTN_STOP.Click
Timer1.Stop()
End Sub
Sub rancangtabel()
lv.Columns.Add("waktu", 100, HorizontalAlignment.Left)
lv.GridLines = True
lv.FullRowSelect = True
lv.View = View.Details
End Sub
Sub isitabel()
Dim x As New ListViewItem
x.Text = JAM.Text & ":" & MENIT.Text & ":" & DETIK.Text & ":" & MILIDETIK.Text
lv.Items.Add(x)
End Sub
Private Sub ListView1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lv.SelectedIndexChanged
End Sub
Private Sub BTN_RECORD_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTN_RECORD.Click
isitabel()
End Sub
Private Sub BTN_KELUAR_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTN_KELUAR.Click
End
End Sub
Private Sub STOPWATCH_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Call rancangtabel()
End Sub
End Class
Jumat, 13 Desember 2013
Langganan:
Posting Komentar (Atom)
0 komentar:
Posting Komentar