CodeItBetter Programming Another VB Programming Blog

How to design a digital clock

Posted on January 4, 2009
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
'Miscellaneous - How to design a digital clock
'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
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


 

No trackbacks yet.