title: How to stop the timer in click event ? In C#.Net?
body: <p>How do you stop the Winforms timer firing Tick event?</p>
  
  <p>this is my code: </p>
  
  <pre><code>    Timer tm = new Timer();
  
      private void button1_Click(object sender, EventArgs e)
      {
          tm = new Timer();
          tm.Interval = 1000;
          tm.Tick += new EventHandler(tm_Tick);
          tm.Start();
      }
  
      void tm_Tick(object sender, EventArgs e)
      {
          MessageBox.Show("hi");
          tm.Stop();
  
      }
  </code></pre>