Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Want a label to display current time

Status
Not open for further replies.

juliesmomma

Technical User
Jun 3, 2002
36
US
I want to be able to display current time in a label (lblTime) where it is updated every second. I have a Timer control on my form set to 1 second interval. Thanks for any help!
 
In the timer event just put:

lblTime.Caption=Time
lblTime.Refresh ' Just to make sure
 
In FormLoad event:
Timer1.Interval = 1000
Timer1.Enabled = True

In Timer1_Timer:
lblTime.Caption = Time

You might look at Status bar control Style property as well! Let me know if this helps
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
Thanks a bunch! I am trying to learn VB6. I was trying to make something hard out of something simple.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top