namespace CountDown

    public partial class Form1 : Form
    {
        public int counter = 0;

        public Form1()
        {
            InitializeComponent();
        }

         private void btnStart_Click(object sender, EventArgs e)
        {
            int parsedValue;

            if (!int.TryParse(txtInput.Text, out parsedValue))
            {
                MessageBox.Show("Please Enter Numbers Only");
            }
            else
            {
                counter = Convert.ToInt32(txtInput.Text);

                timer1 = new Timer();
                timer1.Tick += new EventHandler(timer2_Tick);
                timer1.Interval = 1000 * 60; // 1 second converts to 1 minute by adding * 60

                timer1.Start();
                lblDisplay.Text = counter.ToString();

                lblDisplay.Text = txtInput.Text;
                lblDisplay.Visible = true;
            }
        }

        private void timer2_Tick(object sender, EventArgs e)
        {
            counter--;
            if (counter == 0)

            timer1.Stop();
            lblDisplay.Text = counter.ToString();
        }
    }

Edited 5 Months Ago by Thobani_1

Forgot to post a follow up question but thats the code am using to do a count down timer in MINUTES. I need to also display minutes and seconds at the same time. MIN:SEC. Please help

Wait, do you need some formula to show text from an integer of seconds to minutes? That seems something rather basic.

That is, are you asking folk to code this for you?

PS. I'm sure you are seeing more and more folk ask for code. In this discussion you appear to be asking for code you expect a first year coder to be able to handle.

Q. What's eluding you here? Is it the math or somethign else?

Edited 5 Months Ago by rproffitt