VB6 Clock

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

B3gbie

Thread Starter
Joined
Nov 30, 2001
Messages
228
Anybody know how to get a clock with time and date onto a label and update every second, i can do it at form load, but the time remains the same as long as that form is displayed. Thanks
 
Joined
Oct 10, 2001
Messages
186
There are a couple of ways to do this: one is to add a statusbar control on the form and set one of the panels to time style.

The other as already mentioned is to use a timer control:

Private Sub Timer1_Timer()
Label1.Caption = Now()
End Sub

Private Sub Form_Load
With Timer1
.Enabled = True
.Interval = 500
End With
End Sub

This sets the timer to fire approx every 1/2 second so the clock display is likely to be accurate to that kind of resolution.
 

B3gbie

Thread Starter
Joined
Nov 30, 2001
Messages
228
Thanks guys, thats a big help. I's always the smallest things that pose the biggest problems.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top