I have a suggestion
Since all your text boxes shall accept only numbers, I think it is better to use
masked TextBox.
As you are calling
addaction() in
txtsilabordercharges_TextChanged the totalling will be done only if the text changes in txtsilabordercharges_TextChanged. But when text changes in other text boxes, then also you need to calculate total. Hence, either use a button to calculate the total, or bind the TextChanged event of all the TextBoxes to the same event handler as below
txtsilabordercharges.TextChanged += TextBox_TextChanged;
txtbattacharges.TextChanged += TextBox_TextChanged;
txtdriverpayment.TextChanged += TextBox_TextChanged;
txtrent.TextChanged += TextBox_TextChanged;
txtextra.TextChanged += TextBox_TextChanged;
txtdiscount.TextChanged += TextBox_TextChanged;
private void TextBox_TextChanged(object sender, EventArgs e)
{if (!string.IsNullOrEmpty((sender as TextBox).Text)))
addaction();
}