I think just you need to check the value of your textbox first cause you can`t convert null value to Double
if (textBox1.Text!="")
{
m = kilometer * Convert.ToDouble(textBox1.Text);//here is the problem
textBox2.Text = m.ToString();
}
or give textBox1 initial value before start calculation,
Note: If you use number Regex for TextBox1 this will be better
Thanks.
solved Error input string was not in correct formalt