Click here to Skip to main content
15,896,606 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all

How to refresh a label for every 1 second in windows form,

I am working with a time, in a label

where
C#
Lbl_time.text = DateTime.Now.ToString();


It has to refresh for every second how can i do it ?
Please send me code.

Edit: Code formatted
Posted
Updated 8-Sep-11 16:19pm
v2

 
Share this answer
 
Add timer object to windows form and keep interval of 1 sec and add
C#
Lbl_time.text = DateTime.Now.ToString();
in timer object Elapsed event
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900