Try:
Private void AmountPaid_TextChanged(object sender, system.EventArgs e)
{
double Balance;
double Amount1 = Convert.ToDouble(this.Amount.Text);
double Amount2 = Convert.ToDouble(this.AmountPaid.Text);
Balance = Amount1 - Amount2;
}
Or:
Private void AmountPaid_TextChanged(object sender, system.EventArgs e)
{
double Balance;
double Amount1 = Double.Parse(this.Amount.Text);
double Amount2 = Double.Parse(this.AmountPaid.Text);
Balance = Amount1 - Amount2;
}
If your users can enter non-numeric data, then you need to look at TryParse instead:
Private void AmountPaid_TextChanged(object sender, system.EventArgs e)
{
double Balance;
double Amount1;
double Amount2;
if (Double.TryParse(Amount.Text, out Amount1) && Double.TryParse(AmountPaid.Text, out Amount2))
{
Balance = Amount1 - Amount2;
}
}