title: Check if the countdown timer is 0
body: <p>I have a script based on the countdown timer. I want that when the time reaches 0, the timer stop and a message appear. The code id this:</p>
  
  <pre><code>public partial class simulare : Form
      {
          private admin admin;
          Timer timer = new Timer();
          public simulare(admin admin)
          {
              InitializeComponent();
              this.admin=admin;
              label2.Text = TimeSpan.FromMinutes(0.1).ToString();
          }
          private void simulare_Load(object sender, EventArgs e)
          {
              var startTime = DateTime.Now;
              timer = new Timer() { Interval = 1000 };
              timer.Tick += (obj, args) =&gt;
              label2.Text = (TimeSpan.FromMinutes(0.1) - (DateTime.Now - startTime)).ToString("hh\\:mm\\:ss");
              timer.Enabled = true;
              timer.Start();
              if (condition)
              {
                  timer.Stop();
                  MessageBox.Show("Done!");
              }
          }
      }
  </code></pre>
  
  <p>I tried those conditions, but unsuccessful:</p>
  
  <pre><code>if (timer.ToString() == TimeSpan.Zero.ToString())
  
  if (label2.Text.ToString() == TimeSpan.Zero.ToString())
  
  if (label2.Text == TimeSpan.Zero)
  </code></pre>