private void menuItem2_Click(object sender, EventArgs e){try{float gas = float.Parse(textBox1.Text);float bMile = float.Parse(textBox2.Text);float eMile = float.Parse(textBox3.Text);//if gas or endmiles is 0 errorif (gas == 0 ){this.label6.Text = "Gallons is zero ";}if(eMile == 0){this.label6.Text = "Ending Mileage is zero ";}//see if begining mileage is larger than ending mileageif (bMile >= eMile){this.label6.Text = "End mileage less than begin mileage ";}//if negative values are enteredif (gas < 0){this.label6.Text = "Gallons is negative ";}if (bMile < 0){this.label6.Text = "Begning Miles is negative ";}if (eMile < 0){this.label6.Text = "Ending Miles is negative ";}this.label6.Text = String.Format("Result: {0}", (eMile - bMile) / gas);}catch (FormatException ex){// string was not a number, handle the error or just use a formatted text box, // NumericUpDown, etc.}}