Good day everyone,
First of all, thank you for taking the time to read my request, it means alot.
I have created a windows form on VB 2019.
When a user puts a number into textbox 5, I want the following equation to be calculated and the total displayed in Textbox8.
The below works to some level, but if the number is negative (example: -200) it does not work.
Also if the user tries to clear the text box, it always crashes with the same error " System.FormatException: 'Input string was not in a correct format.'
My guess is this has something to do with the variable I am using and cannot recognise a character.
Thanks again people, I really appreciate your time and expertise.
- private void textBox5_TextChanged(object sender, EventArgs e)
- {
- double firstbox;
- double answer;
- firstbox = double.Parse(textBox5.Text);
- answer = firstbox / 1000 * 3.18141 * 2.3 * 1.19;
- textBox8.Text = (answer.ToString());
- }