I hope you can help me please, I want to perform the calculation of these 3 operations (2 divisions and 1 multiplication) with a single button (so I do not have to do them separately) but I do not know how to do it. My code is as follows:
private void btnCalcular_Click(object sender, EventArgs e)
{
double fijo = double.Parse(lblfijo.Text);
double num3 = double.Parse(txtTC.Text);
double div = fijo / num3;
txtResultado.Text = div.ToString();
}
private void btnCalcular2_Click(object sender, EventArgs e)
{
double resul1 = double.Parse(txtResultado.Text);
double num2 = double.Parse(txtEFF.Text);
double mul = resul1 * num2;
txtResultado2.Text = mul.ToString();
}
private void btnCalcular3_Click(object sender, EventArgs e)
{
double operador = double.Parse(txtoperador.Text);
double resul2 = double.Parse(txtResultado2.Text);
double div = operador / resul2;
txtResultado3.Text = div.ToString();
}
PS: I use "double" for the numbers with a decimal point since the value of txtEFF.Text is a percentage.