Exemplo n.º 1
0
 private void button1_Click(object sender, EventArgs e)
 {
     removeLabel = true;
     countedDays = 0;
     moving      = true;
     try
     {
         days = Convert.ToInt32(textBox1.Text);
     }
     catch (FormatException e1)
     {
         textBox1.Text = "";
         System.Windows.Forms.MessageBox.Show("Input is not a valid number(int)");
     }
     catch (OverflowException e1)
     {
         System.Windows.Forms.MessageBox.Show("This number doesn't fit in Int32");
         textBox1.Text = "";
     }
     if (!checkBox2.Checked)
     {
         timerEvent.start(Convert.ToInt32(days), false);
         countedDays = days;
         removeLabel = true;
         removeLabels();
     }
     else if (checkBox2.Checked)
     {
         timerEvent.start(Convert.ToInt32(days), true);
     }
     removeLabels();
     this.Invalidate();
 }