Time in Form

baffilustri

Member
Joined
Sep 22, 2008
Messages
6
Programming Experience
3-5
Hi,
how can I put and view the current time in a windows form??

thanx
 
Hi, you'll need a label control (position it where ever you like)call it lblCurrentTime, and a timer control. In the timer tick event....

VB.NET:
lblCurrentTime.Text = String.Format("{0:hh:mm:ss tt}", _
         Date.Now)

the timer interval should be set at 1000.

I think that should do it.
 
Back
Top