1. Method SelectedIndexChanged control is called when loading form on which it is located? or is it not called along with the form on which it is located?

  2. How to avoid this error? alt text

    2 answers 2

    1. Probably, you initialize combobox3 in Form Load, so its value changes.
    2. You have entered the number in the wrong format in textbox1. By the way, the format, roughly speaking, depends on the language chosen in the OS. For example, in the English OS, you must enter "3. 14", and in Russian - "3 , 14". There are other ways to solve this problem.
    • And I have a number without dots and commas, I set it textBox1.Text = "345"; . And in the Form1_Load method the same entry F = 1000 * Convert.ToDouble (textBox1.Text); running and the variable F takes the value. no error occurs. And in the comboBox3_SelectedIndexChanged method, it gives an error. - Vezd

    Check in the debugger or print out the actual value of textBox1.Text. Maybe at the moment when the conversion occurs, is it just null? If so, add a check.

    if (textBox1.Text != null) { }