3
I’m using the event textBox_Changed
and when I type a value into the field, another textBox
should receive this value, but this other textBox
called ValorTotalVenda
is accumulating this amount.
private void textBox4_TextChanged(object sender, EventArgs e)
{
if (textBox4.Text != "")
{
venda.ValorAcrescimo = Convert.ToDecimal(textBox4.Text);
venda.ValorTotalVenda += venda.ValorAcrescimo;
textBox6.Text = Convert.ToString(venda.ValorTotalVenda);
}
}
Dude, there’s no textbox in your code called Valortotalvenda. It has a property (probably Decimal) and you add the value of the property Valoracrescimo. If you want the textBox6 to receive the value typed in the textBox4 you should do only
textBox6.Text = textBox4.Text
.– igventurelli