decimal aPrice = 15.75m;
decimal aSales = decimal.Parse(txtASales.Text);
decimal aRev = (aPrice * aSales);
private void btnCalculate_Click(object sender, EventArgs e)
{
lblARev.Text = aRev.ToString();
}
This is the code i have for it, what I'm trying to do is multiply the price of A-type tickets and the number of A-type tickets sold. The number sold will be taken from the user in a text box "txtASales" which I got from the object window, and renamed in the properties window (no coding done for that). Then the revenue will be shown on a label "lblARev". I am getting an error "A field initializer cannot reference the non-static field, method, or property" for txtASales, aPrice, and aSales.