Exemple #1
0
 private void RectangleCalculateButton_Click(object sender, RoutedEventArgs e)
 {
     if (Judge.IsNumber(Side1Textbox.Text) && Judge.IsNumber(Side2Textbox.Text) && Judge.IsNumber(Side3Textbox.Text))
     {
         double data1 = Convert.ToDouble(Side1Textbox.Text);
         double data2 = Convert.ToDouble(Side2Textbox.Text);
         double data3 = Convert.ToDouble(Side3Textbox.Text);
         if ((data1 + data2 > data3) && (data1 + data3 > data2) && (data2 + data3 > data1))
         {
             TriangleCalculate MyTriangleCalculate = new TriangleCalculate();
             TriangleAreaTextbox.Text = MyTriangleCalculate.CalculateArea(unit, data1, data2, data3);
         }
         else
         {
             Warning.Sound();
             MessageBox.Show("This is not a triangle!");
         }
     }
     else
     {
         Warning.Sound();
         MessageBox.Show("The things you input must be numbers!");
     }
 }