This is the partial codes i wrote for an alarm clock application but why the counting down time don't worked? Thanks in advance :)
int intTimeDelay = 10;
private void mnu5Sec_Click(object sender, EventArgs e)
{
intTimeDelay = 5;
//intTimeDisplay = 5;
}
private void mnu10Sec_Click(object sender, EventArgs e)
{
intTimeDelay = 10;
//intTimeDisplay = 10;
}
private void mnu15Sec_Click(object sender, EventArgs e)
{
intTimeDelay = 15;
//intTimeDisplay = 15;
}
DateTime SnoozeTime;
private void btnSNOOZE_Click(object sender, EventArgs e)
{
btnResetTime.Enabled = false;
pnlDisplay.BackColor = SystemColors.Control;
myPlayer.Stop();
SnoozeTime = DateTime.Now.AddSeconds(intTimeDelay);
TimeDelayed.Enabled = true;
TimerCheck.Enabled = true;
}
private void TimeDelayed_Tick(object sender, EventArgs e)
{
int intTimeDisplay = intTimeDelay;
for (int intCount = intTimeDelay; intCount >= 1; intCount--)
{
mnuTimeDisplay.Text = Convert.ToString(intTimeDisplay--) + " Secs";
}
}