title: Calculating a total without using a click event C#
body: <p>I wrote a Windows Form Application calculator which takes square footage of specific parts of a home and estimates approximately how much it would cost to rebuild that structure.</p>
  
  <p>I am using TextChanged events so that as the user types input it converts the square footage to the calculated rebuild cost. </p>
  
  <pre><code>public void txtBuiltInGarage_TextChanged(object sender, EventArgs e)
  {
      int outputValue = 0;
      bool isNumber = false;
  
      isNumber = int.TryParse(txtBuiltInGarage.Text, out outputValue);
  
      if (!isNumber)
      {
          txtBuiltInGarage.Text = "";
          txtBuiltInGarageCost.Text = "";
      }
      else
      {
          int builtinGarageSQ;
          int builtinGarageCostPerSF = 100;
  
          builtinGarageSQ = int.Parse(txtBuiltInGarage.Text.ToString());
          builtinGarageCost = builtinGarageSQ * builtinGarageCostPerSF;
          txtBuiltInGarageCost.Text = builtinGarageCost.ToString();
      }
  }
  </code></pre>
  
  <p>However, I want this functionality to carry over to the total of all the fields. For examples, when the user enters 100 square feet for a built in garage, it will displayed the sum of 100 * 100 in the txtBuiltInGarageCost, but it will also display the total in the sum box and check it against the other value fields to see if any further calculation should be taking place. Basically, this application is a conversion of an earlier Excel Spreadsheet and I want to keep the "sum as you go along" feel to it. The problem with using a click event is that because some fields remain editable after the button is clicked I have to write a work around which I think detracts from the over all feel of a well written program. Here is what my code looks like when the user clicks the calculate button.</p>
  
  <pre><code>private void btnCalculate_Click(object sender, EventArgs e)
  {
      totalRC = livingSpaceCost + builtinGarageCost + attachedGarageCost + deckCost + openPorchCost + enclosedPorchCost + additionalFeaturesCost;
      txtTotalReplacementCost.Text = totalRC.ToString();
  
      txtLivingSpace.ReadOnly = true;
      txtBuiltInGarage.ReadOnly = true;
      txtAttachedGarage.ReadOnly = true;
      txtDeck.ReadOnly = true;
      txtEnclosedPorch.ReadOnly = true;
      txtOpenPorch.ReadOnly = true;
      txtAdditionalFeaturesCost.ReadOnly = true;
      cmbConstructionQuality.Visible = false;
      lblConstructionQualityOutput.Visible = true;
      cmbConstructionType.Visible = false;
      lblConstructionTypeOutput.Visible = true;
      lblClearAlert.Visible = true;
  
      lblConstructionQualityOutput.Text = cmbConstructionQuality.SelectedItem.ToString();
      lblConstructionTypeOutput.Text = cmbConstructionType.SelectedItem.ToString();
  }
  </code></pre>
  
  <p>So how can I make txtTotalReplacementCost automatically calculate as I input/change values in the other fields?</p>