private void Totaltxt_KeyDown(object sender, KeyEventArgs e) { if (txttax.SelectedIndex > 0 && Totaltxt.Text != "" ) { double Quantity1 = Convert.ToDouble(txtqty.Text); double Price1 = Convert.ToDouble(qtytxtprice.Text); double Price2 = 0; double Quantity2 = 1; //float q; try { Price2 = Convert.ToSingle(Totaltxt.Text); Quantity2 = Convert.ToDouble((Quantity1 / Price1) * Price2); txtqty.Text = Quantity2.ToString("F2"); } catch { } } }
double Quantity1 = 1.00; double Price1 = 60.0; double Price2 = 51.0; double Quantity2 = (Quantity1 / Price1) * Price2;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)