sir please help me make clock this is very useful to me please help!!!
Read Ad-free Manga, Manhwa, and Manhua at https://trilliux.me!
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Timer_Example
{
public partial class fclsTimerExample : Form
{
public fclsTimerExample()
{
InitializeComponent();
}
private void fclsTimerExample_Load(object sender, EventArgs e)
{
DateTime dtCurrentTime = DateTime.Now;
lblClock.Text = dtCurrentTime.ToLongTimeString();
}
private void timer1_Tick(object sender, EventArgs e)
{
DateTime dtCurrentTime = DateTime.Now;
lblClock.Text = dtCurrentTime.ToLongTimeString();
}
private void label1_Click(object sender, EventArgs e)
{
}
private void tabPage1_Click(object sender, EventArgs e)
{
}
private void tmrDate_Tick(object sender, EventArgs e)
{
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
}
}
// Given that the user enters correct date and time
modifiedDate = DateTime.Parse( textBox1.Text );
private void timer1_Tick(object sender, EventArgs e)
{
// Add the seconds interval you have specified in the Timmer.
// I am adding 1 second
modifiedDate = modifiedDate.AddSeconds(1);
lblClock.Text = modifiedDate.ToLongTimeString();
}
// Class Definition
private DateTime modifiedDate = DateTime.Now
Similar topics
Permissions in this forum:
You cannot reply to topics in this forum
|
|