private void 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(); } private void 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(); }
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: