alarme
Post your questions regarding programming in C# in here.
2 posts
Page 1 of 1
You could use a timer to check DateTime.Now to see if it matches what you want.
Code: Select all
private void Form1_Load(object sender, EventArgs e)
{
timer1.Interval = 1000; //1 second
timer1.Start();
}
private void timer1_Tick(object sender, EventArgs e)
{
DateTime now = DateTime.Now;
if (now.Date.ToString("dd-MM-yy") == "06-05-12")
{
if (now.Hour == 0 && now.Minute == 52)
{
timer1.Stop();
MessageBox.Show("Time up");
}
}
}
2 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023