Create Digital Clock In VB.NET

How to create Digital Clock?

Explanation

Code To Create a Digital Clock in Vb.net 2008. Following is the code to create a digital clock in vb.net.
Code:
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
Timer1.Start()
End Sub
Public Sub Timer1_Tick(ByVal sender As Object,
ByVal e As EventArgs)
Label1.Text = TimeOfDay
End Sub
End Class
Description:
  • 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