3
Answers

error on clearing textbox

Photo of anil john

anil john

12y
1.8k
1
I am getting an error : Input string not in correct format , while am clearing the text box, plz help me to rectify this error

double taxAmnt =0;

private void textBox2_TextChanged(object sender, EventArgs e)

        {

            if (chkTax.Checked)

            {

                taxAmnt = ((fAuctionProfit * Convert.ToDouble(txtTax.Text)) / 100);

            }

            else

            {

                taxAmnt = Convert.ToDouble(txtTax.Text);

            }

            txtNetProfit.Text = (fAuctionProfit - taxAmnt - bonusAmnt-serviceChrg ).ToString ();

        }

Answers (3)