I am trying to ad a countdown timer to my maze game
<p>I am making a maze game </p>

<p>I wrote this:</p>

<pre><code> private int counter = 60;
        private void button1_Click(object sender, EventArgs e)
        {
            int counter = 60;
            timer1 = new System.Windows.Forms.Timer();
            timer1.Tick += new EventHandler(timer1_Tick);
            timer1.Interval = 1000; //one second
            timer1.Start();
            label1.Text = counter.ToString();

        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

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

                timer1.Stop();                
            label1.Text = counter.ToString();



            }
        }
    }
</code></pre>

<p>After this I want a <code>Messagebox</code> to appear when the timer ends on <code>0</code>. When I click on the OK button I want the form to close.</p>
