Rancang Form Seperti di bawah ini :
Tambahkan 1 buah label dan timer.
Kode program untuk form jam :
Public Class Form1
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Me.Label1.Text = Format(Now, "HH:MM:ss")
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Timer1.Enabled = True
Me.Timer1.Interval = 1000
End Sub
End Class
Hasil program :
Tambahkan 1 buah label dan timer.
Kode program untuk form jam :
Public Class Form1
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Me.Label1.Text = Format(Now, "HH:MM:ss")
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Timer1.Enabled = True
Me.Timer1.Interval = 1000
End Sub
End Class
Hasil program :
Post a Comment