Okay, I've got an order form that needs to calculate the total each time a quantity is updated. I have it set up the way I think it should work. I've added one of my methods here for my QuantityBox_TextChanged. I have 3 quantity boxes like this, and I set them all up like this pretty much. When I select a check box, it enables the quantity box - but when I type a number in it, it throws an exception. Any ideas?

private void WhiteFuzzyDiceQuantityBox_TextChanged(object sender, EventArgs e)
    {
        double result = 0.0;
        // exception handling for quantity boxes(no text allowed in them)
        try
        {
            double RedQuantityBox = double.Parse(this.RedFuzzyDiceQuantityBox.Text);
            double BlackQuantityBox = double.Parse(this.BlackFuzzyDiceQuantityBox.Text);
            double WhiteQuantityBox = double.Parse(this.WhiteFuzzyDiceQuantityBox.Text);

            result = (BlackQuantityBox + WhiteQuantityBox + RedQuantityBox)*cost;
        }
        catch(FormatException)
        {
            MessageBox.Show("Not a valid number for quantity box, \nplease enter a number");
        }
        //displays results
        this.DisplayResults(result);
    }

Oh yeah, it only throws it once, after i put a number in after it throws it, it does what it is supposed to do.

I figured it out using something else.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.