In this program,
you have to insert a timer control into the form . Then go to the properties
window to set the timer's interval value to 1000 so that Visual Basic updates
the time every 1000 milliseconds, or once a second. Other properties that you
ought to set are to change the caption (here is My Clock) and to set
Form1's MaxButton to false (so that it cannot be maximized by the user)
Now, double click
the timer and enter the one line code as follows:
Private Sub Timer1_Timer()
Label1.Caption = Time
End Sub
No comments:
Post a Comment