Cara Membuat Stop Watch Dengan VB

Buatlah Sebuah Form Seperti Pada Gambar.

Setelah Membuat Tampilan Seperti pada Gambar, Masukan Listing Program Berikut:

Option Explicit

Private Sub Command1_Click()
Select Case Command1.Caption
Case “Start”
Timer1.Enabled = True
Command1.Caption = “Stop”
Case “Stop”
Timer1.Enabled = False
Command1.Caption = “Start”
End Select
End Sub

Private Sub Timer1_Timer()
text1.Text = text1.Text + 1
End Sub

Private Sub text1_Change()
If text1.Text = “59” Then
text1.Text = “00”
text2.Text = text2.Text + 1
End If
text1.Text = Format(text1.Text, “00”)
End Sub

Private Sub txt2_Change()
If text2.Text = “59” Then
text2.Text = “00”
text3.Text = text3.Text + 1
End If
text2.Text = Format(text2.Text, “00”)
End Sub

Private Sub txt3_Change()
text3.Text = Format(text3.Text, “00”)
End Sub

Tinggalkan Balasan

Please log in using one of these methods to post your comment:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: