Home > How-To Library > Miscellaneous

How to design a digital clock

**************************************************************** * © 2007 CodeItBetter http://www.codeitbetter.com * * This notice MUST stay intact for legal use * ****************************************************************
'Insert a timer control and a label control name it as lblClock, in a form 'and place the following code Private Sub Form_Load() Timer1.Interval = 500 End Sub Private Sub Timer1_Timer() Dim strTime As String strTime = Time$ If Mid$(lblClock.Caption, 3, 1) = ":" Then Mid$(strTime, 3, 1) = " " Mid$(strTime, 6, 1) = " " End If lblClock.Caption = strTime End Sub

If you would like to submit your code here please us. Do not forget to mention your name. We are always thankful to each and everyone of you who submitted their code here.