예제 #1
0
 public SolutionForm(CalcResult calculatedValue)
 {
     try
     {
         Bitmap bmp = new Bitmap(@"..\..\Images\Bernoulli_computation.bmp");
         this.BackgroundImage = bmp;
     }
     catch (Exception e)
     {
         MessageBox.Show(e.Message.ToString());
     }
     InitializeComponent();
     DisplayResult(calculatedValue.ResultText);
 }
 /// <summary>
 /// Click event for btn_Calculate
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btn_Calculate_Click(object sender, EventArgs e)
 {
     if (rb_CalcAreaFromRadius.Checked || rb_CalcAreaFromSide.Checked || rb_CalcIntToBinary.Checked || rb_CalcIntToHex.Checked)
     {
         if (!ErrorsExist(true))
         {
             string     numberString = txt_Value1.Text;
             CalcResult calcResult   = new CalcResult();
             calcResult.ResultText = GenerateResult(numberString);
             //SolutionForm solutionForm = new SolutionForm(GenerateResult(this.txt_Value1.Text));
             SolutionForm solutionForm = new SolutionForm(calcResult);
             solutionForm.ShowDialog();
         }
     }
     else
     {
         MessageBox.Show("Select a calculation choice radio button to perform a calculation.");
     }
 }