title: C# Calculator with memory buttons
body: <p>I am having some difficulties making my calculator have the ability to store values. The calculator works for everything except this and I am quite stuck. I think I might have to declare some constants or something that I am missing right now. I am super new at this and appreciate the help. Here is my code. Thanks for any help guys. Right now I am getting no errors but nothing works either! I am also supposed to make it so a "M" appears in a textbox when there is a value stored in memory but I figured it was easier to start with this part.</p>
  
  <pre><code>private void digitCalculate_Click(object sender, EventArgs e)
      {
  
          Button ButtonThatWasPushed = (Button)sender;
          string ButtonText = ButtonThatWasPushed.Text;
          decimal EndResult = 0;
          decimal MemoryStore = 0;
  
          if (ButtonText == "MC")
          {
              //Memory Clear
              MemoryStore = 0;
              return;
          }
  
          if (ButtonText == "MR")
          {
              //Memory Recall
              txtDisplay.Text = MemoryStore.ToString();
              return;
          }
  
          if (ButtonText == "MS")
          {
              // Memory subtract
              MemoryStore -= EndResult;
              return;
          }
  
          if (ButtonText == "M+")
          {
              // Memory add 
  
              MemoryStore += EndResult;
              return;
  
          }
  
      }
  </code></pre>