title: Countdown timer goes into negative number (00:00:00)
body: <p>I  made a simple countdown timer but the timer goes into negative <code>-1 : 59 : 59</code> when i input <code>0 : 0 : 0</code> on the textboxes. i tried to input <code>0 : 0 : 1</code> and the timer stopped at <code>0 : 0 : 0</code> and the messagebox appear on the screen</p>
  
  <p>i have tried this code to prevent negative value but it stopped at <code>-1 : 59 : 58</code></p>
  
  <pre><code>if (label1.Text == "-1")
  {
      timer1.Stop()
  }
  </code></pre>
  
  <p>tried this code but it stopped at <code>-1 : 59 : 59</code></p>
  
  <pre><code>if (h &lt; 0)
  {
      timer1.Stop();
  }
  </code></pre>
  
  <p>here is the codes</p>
  
  <pre><code>namespace Timer
  {
  
      public partial class Form1 : Form
      {
  
          int h;
          int m;
          int s;
          public Form1()
          {
              InitializeComponent();
          }
  
          private void button1_Click(object sender, EventArgs e)
          {
              if (textBox1.Text == "")
              {
                  textBox1.Text = "0";
              }
              if (textBox2.Text == "")
              {
                  textBox2.Text = "0";
              }
              if (textBox3.Text == "")
              {
                  textBox3.Text = "0";
              }
  
              h = Convert.ToInt32(textBox1.Text);
              m = Convert.ToInt32(textBox2.Text);
              s = Convert.ToInt32(textBox3.Text);
  
              timer1.Start();
          }
  
          private void timer1_Tick(object sender, EventArgs e)
          {
              s = s - 1;
  
              if(s == -1)
              {
                  m = m - 1;
                  s = 59;
              }
  
              if (m == -1)
              {
                  h = h - 1;
                  m = 59;
              }
              if (h == 0 &amp;&amp; m == 0 &amp;&amp; s == 0)
              {
                  timer1.Stop();
                  MessageBox.Show("Times up!", "Time");
              }
  
              string hh = Convert.ToString(h);
              string mm = Convert.ToString(m);
              string ss = Convert.ToString(s);
  
              label1.Text = hh;
              label2.Text = mm;
              label3.Text = ss;
          }
  
          private void button2_Click(object sender, EventArgs e)
          {
              timer1.Stop();
          }
      }
  }
  </code></pre>