title: Getting my calculator to take a new number after the equal button is pressed
body: <p>So I have been at this for a while now and still cannot get my calculator to do one final thing. </p>
  
  <p>I got it thanks!</p>
  
  <p>After I push the equal button or Tan, Sin, Cos or Mod buttons I want my calculator to take a new number. Basically as if nothing was in the textbox even though the answer is still there. Currently, all the numbers stay and the new number is added to the end. I do not want this to happen. </p>
  
  <p>After the calculation, if I push a number button I want it to clear the screen and add the new number fresh. Below is my code that I have so far. </p>
  
  <pre><code>public partial class Form1 : Form
  {
      public Form1()
      {
          InitializeComponent();
      }
      Double FirstNumber;
      string mathOperator = "";
  
      private void AddButton_Click(object sender, EventArgs e)
      {
          FirstNumber = Convert.ToDouble(DisplayTextBox.Text);
          mathOperator = "+";
  
          DisplayTextBox.Text = "";
          DisplayTextBox.Focus();
  
      }
      private void EqualButton_Click(object sender, EventArgs e)
      {
          Double SecondNumber;
          SecondNumber = Convert.ToDouble(DisplayTextBox.Text);
  
          switch (mathOperator)
          {
              case "+":
                  DisplayTextBox.Text = (FirstNumber + SecondNumber).ToString();
                  break;
              case "-":
                  DisplayTextBox.Text = (FirstNumber - SecondNumber).ToString();
                  break;
              case "*":
                  DisplayTextBox.Text = (FirstNumber * SecondNumber).ToString();
                  break;
              case "/":
                  DisplayTextBox.Text = (FirstNumber / SecondNumber).ToString();
                  break;
              default:
                  break;
          }
      }
  
      private void button12_Click(object sender, EventArgs e)
      {
          FirstNumber = Convert.ToDouble(DisplayTextBox.Text);
          FirstNumber *= -1;
          DisplayTextBox.Text = FirstNumber.ToString();
  
      }
  
      private void ButtonMinus_Click(object sender, EventArgs e)
      {
  
          FirstNumber = Convert.ToDouble(DisplayTextBox.Text);
          mathOperator = "-";
  
          DisplayTextBox.Text = "";
          DisplayTextBox.Focus();
  
      }
  
      private void ButtonMultiply_Click(object sender, EventArgs e)
      {
  
          FirstNumber = Convert.ToDouble(DisplayTextBox.Text);
          mathOperator = "*";
  
          DisplayTextBox.Text = "";
          DisplayTextBox.Focus();
  
      }
  
      private void ButtonDivide_Click(object sender, EventArgs e)
      {
  
          FirstNumber = Convert.ToDouble(DisplayTextBox.Text);
          mathOperator = "/";
  
          DisplayTextBox.Text = "";
          DisplayTextBox.Focus();
  
      }
  
      private void ButtonMod_Click(object sender, EventArgs e)
      {
          FirstNumber = Convert.ToDouble(DisplayTextBox.Text);
          DisplayTextBox.Text = Math.Tan(FirstNumber).ToString();
  
      }
  
      private void Button1_Click(object sender, EventArgs e)
      {
          DisplayTextBox.Text = DisplayTextBox.Text + "1";
      }
  
      private void Button2_Click(object sender, EventArgs e)
      {
          DisplayTextBox.Text = DisplayTextBox.Text + "2";
      }
  
      private void Button3_Click(object sender, EventArgs e)
      {
          DisplayTextBox.Text = DisplayTextBox.Text + "3";
      }
  
      private void Button4_Click(object sender, EventArgs e)
      {
          DisplayTextBox.Text = DisplayTextBox.Text + "4";
      }
  
      private void Button5_Click(object sender, EventArgs e)
      {
          DisplayTextBox.Text = DisplayTextBox.Text + "5";
      }
  
      private void Button6_Click(object sender, EventArgs e)
      {
          DisplayTextBox.Text = DisplayTextBox.Text + "6";
      }
  
      private void Button7_Click(object sender, EventArgs e)
      {
          DisplayTextBox.Text = DisplayTextBox.Text + "7";
      }
  
      private void Button8_Click(object sender, EventArgs e)
      {
          DisplayTextBox.Text = DisplayTextBox.Text + "8";
      }
  
      private void Button9_Click(object sender, EventArgs e)
      {
          DisplayTextBox.Text = DisplayTextBox.Text + "9";
      }
  
      private void ButtonClear_Click(object sender, EventArgs e)
      {
          DisplayTextBox.Text = "";
          mathOperator = "";
      }
  
      private void ButtonOff_Click(object sender, EventArgs e)
      {
          Application.Exit();
      }
  
      private void ButtonTan_Click(object sender, EventArgs e)
      {
          FirstNumber = Convert.ToDouble(DisplayTextBox.Text);
          DisplayTextBox.Text = Math.Tan(FirstNumber).ToString();
      }
  
      private void ButtonSin_Click(object sender, EventArgs e)
      {
          FirstNumber = Convert.ToDouble(DisplayTextBox.Text);
          DisplayTextBox.Text = Math.Sin(FirstNumber).ToString();
  
      }
  
      private void ButtonCos_Click(object sender, EventArgs e)
      {
          FirstNumber = Convert.ToDouble(DisplayTextBox.Text);
          DisplayTextBox.Text = Math.Cos(FirstNumber).ToString();
  
      }
  
      private void Button0_Click(object sender, EventArgs e)
      {
          if (DisplayTextBox.Text.Length &gt;= 1)
          {
              DisplayTextBox.Text = DisplayTextBox.Text + "0";
          }
          else
          {
              return;
          }
      }
  
      private void DecimalButton_Click(object sender, EventArgs e)
      {
          if (DisplayTextBox.Text.Contains("."))
          {
              return;
          }
          else
          {
              DisplayTextBox.Text = DisplayTextBox.Text + ".";
          }
      }
  }
  </code></pre>