I've written this code
private void txtRate_TextChanged(object sender, EventArgs e)
{
try
{
decimal qty;
decimal price;
decimal amt = 0;
qty = Convert.ToDecimal(txtQuantity.Text);
price = Convert.ToDecimal(txtRate.Text);
amt = qty * price;
txtAmount.Text = amt.ToString();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
For getting an value in txtAmount textbox automatically and I can get it correctly.
After that I want to clear all textbox, so I wrote this
txtProdSerName.Text = "";
txtQuantity.Text = "";
txtRate.Text = "";
txtAmount.Text = "";
but I am getting error
input string was not in a correct format
because textchange event occurs again here.
PLEASE GIVE ME SOME SUGGESTION OR SOLUTION ABOUT THIS
txtQuantity.TextandtxtRate.Text?