Using Timer in C#

1,Drag & drop timer from Visual Studio tool box

2,To start timer
timer1.Start();
3,To Stop Timer
timer1.Stop();
4,Timer Tick event (Executes every second if timer started) 

private void timer1_Tick(object sender, EventArgs e)
{
commands
}

5,To count down using Timer

private void timer1_Tick(object sender, EventArgs e)
{
label3.Text = (Convert.ToInt32(label3.Text) - 1).ToString();
}




No comments:

^ Top