Tuesday, September 13, 2016

VB Solution: Easy step to create a Digital Clock in Visual Studio 2012/2015

It is an easy way for newbie in Visual Studio and VB.Net to create a simple Digital Clock. You can find source code and full video example at the link below or you can follow easy steps:
  1.  Create a form and add 
    • Label for time, Label for date
    • Timer tool
  2. Import
    • Imports System.Windows.Forms.VisualStyles.VisualStyleElement.TaskbarClock 
Example Full Source Code:
Imports System.Windows.Forms.VisualStyles.VisualStyleElement.TaskbarClock
Public Class digitalclock

    Private Sub digitalclock_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        lbTime.Text = TimeOfDay
        lbDate.Text = Date.Today.ToString("dd MMM, yyyy")
    End Sub

    Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
        lbTime.Text = TimeOfDay
    End Sub
End Class

Download source code for free: Digital Clock 
Note: This script is working fine with Visual Studio 2012 and above.

0 comments :

Post a Comment