How to make countdown timer in c#.net
Hello friends,
After a very very long time , lets grab some interesting stuff...
==================================================
Today I'll show how to make a countdown timer in c#.net.
==================================================
Step 1: first of all create a new project in c#.net (in visual studio)
FILE>NEW > PROJECT > c# PROJECTS
Step 2 : Now we to set up a timer.
We will make a downtimer here which'll count in decrement way.
Go to : Toolbars .
Under " All Windows Forms " select timer.
appear at bottom of form.
Step 4: Click on timer and go to properties pane
. set Interval as 1000
This'll set time interval of 1 second.
Step 5: Now double click on timer
Write code :
if (tl > 0)
{
tl = tl - 1;
time.Text = tl + " seconds";
}
else
{
timer1.Stop();
time.Text = "Time's up!";
Now FOR THIS SET PUBLICALLY
int tl=<the seconds you want to downcount timer>;
Step 6: That's it you will have timer like this when you'll build the form (Ctrl + F5) :
==================================================
ENJOY !!!!!!!!!!
==================================================
Comments