privatevoid
Form1_Load(object sender, EventArgs e)
{ //Take One New timer... Timer timer1 = new Timer();
//Add Tick Event Of Timer this.timer1.Tick+=new EventHandler(this.timer1_Tick);
timer1.Enabled = true;
//Start The Timer...
timer1.Start();
}
privatevoid
timer1_Tick(object sender, EventArgs e)
{ //Display Current Date & Time Both...
lblTime.Text =
DateTime.Now.ToString();
//For Only Time Use Below Line Instead Of First...
lblTime.Text =
DateTime.Now.Hour.ToString()
+ ":" +
DateTime.Now.Minute.ToString()
+ ":" +
DateTime.Now.Second.ToString();
}
0 comments
Comments
Join the conversation! Your thoughts help the community grow.
Join to leave a comment
Members earn 10 SHARP for a comment, 10 SHARP for a reaction, and 250 SHARP for every blog they publish.
Join the conversation! Your thoughts help the community grow.