Hi,
You can use TextChanged event to calculate, check
txtamont.text and
txtTotalAmount.text are not blank and parse them they are numeric
then Set
txtDue.Text =Convert.ToDecimal(txtTotalAmount.Text) -Convert.ToDecimal(txtamont.Text)
or else you can create a class CalDueAmt where you expose two property
On Text Chnage just Set TotalAmt and Amt get calculated value
class CalDueAmt
{
private decimal _TotalAmt;
public decimal TotalAmt { get { return _TotalAmt;}
set { _TotalAmt=value; Calculate();}
private decimal _Amt;
public decimal Amt { get { return _Amt;}
set { _Amt=value; Calculate();}
private void Calculate()
{
txtDue.Text=_TotalAmt-_Amt;
}
}
you should use this as a nested class of That from where calculation required .