title: "cannot assign because part of method group"
body: <p>I have a form with the following code : </p>
  
  <pre><code>public partial class frmSalesTax : Form
  {
      public frmSalesTax()
      {
          InitializeComponent();
      }
  
      //declare variables
      decimal ItemPrice = 00.00m;
      decimal TaxAmount = 00.08m;
      decimal TotalAmount = 00.00m;
  
      private void btnCalc_Click(object sender, EventArgs e)
      {
          try
          {
              if (decimal.TryParse(txtItemPrice.Text, out ItemPrice))
              {
                  //Instantiated instance of a class here. 
                  CTransaction Calc;
                  Calc = new CTransaction();
  
                  //set properties to calc tax amount.
                  Calc.SalesTaxRate = .08m;
                  Calc.TxtItemPrice = ItemPrice;
  
                  //call the method in the instance of the class
                  TaxAmount = Calc.CalculateTax();
  
                  //Set tax amount property to be available for the calc.
                  Calc.CalculateTax = TaxAmount;
  
                  //call the method in the instance of the class.
                  TotalAmount = Calc.CalculateTotal();
  
                  //Display the values
                  lblTaxAmt.Text = TaxAmount.ToString("c");
                  lblTotal.Text = TotalAmount.ToString("c");
              }
              else
              {
                  MessageBox.Show("Enter a numeric value please");
                  txtItemPrice.Focus();
                  txtItemPrice.SelectAll();
  
                  lblTaxAmt.Text = string.Empty;
                  lblEndTotal.Text = string.Empty;
  
              }
          }
          catch
          {
              MessageBox.Show("Critical Error");
          }
      }
      private void btnExit_Click(object sender, EventArgs e)
      {
          this.Close();
      }
  }
  </code></pre>
  
  <hr>
  
  <p>and a class : </p>
  
  <pre><code>public class CTransaction
  {
      //Create private fields
      private decimal salesTaxRate = .07m;
      private decimal ItemPrice;
      private decimal taxAmount;
  
      //Define the properties
      public decimal SalesTaxRate
      {
          get { return salesTaxRate;}
          set { salesTaxRate = value;}
  }
      public decimal TxtItemPrice
      {
          get { return ItemPrice; }
          set { ItemPrice = value;}
      }
  
      //Custom methods
      public decimal CalculateTax()
      {
          return ItemPrice * SalesTaxRate;
      }
  
      public decimal CalculateTotal()
      {
          return ItemPrice + taxAmount;
      }
  }
  </code></pre>
  
  <hr>
  
  <p>Im getting the "cannot assign to 'CalculateTax' because it  is a method group.  (Form1.cs .. line 54 .. column 21) </p>
  
  <p>The form has the following fields on it for the user to interact with
  txtItemPrice    (textbox)
  3 - buttons (calc, clear, exit) 
  lblTaxAmount (which should display how my tax is being applied to the item. 
  lblEndTOtal (which should be the itemPrice + TaxAmount </p>