Q:

When not entering any value, my program crashes

I have a problem in my windows form in c#. The program is simple;
there are 3 textboxes and then it sums their values. however, when i click on the sum button without entering any values in the other 3 textboxes, the program crashes.
How can i make these textboxes accept only positive numbers and zeros?
this is what i did 
    private void button1_Click(object sender, EventArgs e)
    {
        double FirstNumb = Convert.ToDouble(txtFirstValue.Text);
        double SecondNumb = Convert.ToDouble(txtSecondValue.Text);
        double ThirdNumb = Convert.ToDouble(txtThirdValue.Text);

        double m;

        m = FirstNumb + SecondNumb + ThirdNumb;
        listBox1.Items.Add(m);

    }

A:

You'll want to check that the string value from the text box is not null or empty, or otherwise invalid.  Change this line:
double FirstNumb = Convert.ToDouble(txtFirstValue.Text);
to this
double FirstNumb = 0;
double.TryParse(txtFirstValue.Text, out FirstNumb);

FirstNumb will remain 0 if the parsing fails.  Note that TryParse returns a bool, true if the parsing was successful and false otherwise.  You can also take action on that as well, perhaps showing a MessageBox asking the user to fill a value and exiting the summation method.
See the documentation for more information: http://msdn.microsoft.com/en-us/library/994c0zb1(v=vs.100).aspx
EDIT:  If you want to enforce only positive values, after the try parse you'll have to check that FirstNumb >= 0 and use a MessageBox to alert the user why, and abort the summation method.

