Tutorial Programming

Tutorial basic, Visual Studio VB.NET 2013 Pengunaan Timer


Hallo sahabat saya akan menjelaskan Pengunaan Timer pada visual studio 2013, oke langsung aja



Private Sub BtnStart_Click(sender As Object, e As EventArgs) Handles BtnStart.Click
Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
LblPanel.Text = Val(LblPanel.Text) + 1
End Sub
Private Sub BtnStop_Click(sender As Object, e As EventArgs) Handles BtnStop.Click
Timer1.Enabled = False
End Sub
Private Sub BtnReset_Click(sender As Object, e As EventArgs) Handles BtnReset.Click
LblPanel.Text = 0
End Sub







Public Class Form1
Dim n, m As Integer
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
m = m + 10
If m < 1000 Then
n = Int(1 + Rnd() * 6)
LblDice.Text = n
Else
Timer1.Enabled = False
m = 0
End If
End Sub
Private Sub BtnRoll_Click(sender As Object, e As EventArgs) Handles BtnRoll.Click
Timer1.Enabled = True
End Sub
End Class




Sekian tutorial saya sahabat semoga bermanfaat yah.

No comments:

Post a Comment

Tutorial Programming Designed by Templateism | Ary EJFA Copyright © 2015

Theme images by richcano. Powered by Blogger.