Showing time in HH:MM:SS format

Posted by Raj.Trivedi under C# category on | Points: 40 | Views : 1088

Drag and drop Timer Control
Drag and drop a Label to display time

Double click on the timer control you will generate a TICK event and write this code

private void timer1_Tick(object sender, EventArgs e)
lbldt.Text = DateTime.Now.ToLongTimeString();

Set interval to 1000.

Note :- Do not forget to enable the timer .

Comments or Responses

Login to post response