Create Digital Clock In VB.NET

How to create Digital Clock?


Code To Create a Digital Clock in 2008. Following is the code to create a digital clock in
class="eg"> Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
Timer1 = New Timer
AddHandler Timer1.Tick, AddressOf Timer1_Tick
End Sub
Public Sub Timer1_Tick(ByVal sender As Object,
ByVal e As EventArgs)
Label1.Text = TimeOfDay
End Sub
End Class
  • In the above digital clock example, a new timer is started when a form is loaded.
  • Using a Label the current time is displayed.

Visual Basic Tutorial

Ask Questions

Ask Question