private void btnClose_Click(object sender, System.EventArgs e)
{
Close();
}
private void rdoAddition_CheckedChanged(object sender, System.EventArgs e)
{
double Number1, Number2, Result;
try
{
Number1 = Convert.ToDouble(txtNumber1.Text);
Number2 = Convert.ToDouble(txtNumber2.Text);
Result = Number1 + Number2;
txtResult.Text = Result.ToString();
}
catch(System.FormatException fmtE)
{
MessageBox.Show(fmtE.Message);
}
}
private void rdoSubtraction_CheckedChanged(object sender, System.EventArgs e)
{
double Number1, Number2, Result;
try
{
Number1 = Convert.ToDouble(txtNumber1.Text);
Number2 = Convert.ToDouble(txtNumber2.Text);
Result = Number1 - Number2;
txtResult.Text = Result.ToString();
}
catch(System.FormatException fmtE)
{
MessageBox.Show(fmtE.Message);
}
}
private void rdoMultiplication_CheckedChanged(object sender, System.EventArgs e)
{
double Number1, Number2, Result;
try
{
Number1 = Convert.ToDouble(txtNumber1.Text);
Number2 = Convert.ToDouble(txtNumber2.Text);
Result = Number1 * Number2;
txtResult.Text = Result.ToString();
}
catch(System.FormatException fmtE)
{
MessageBox.Show(fmtE.Message);
}
}
private void rdoDivision_CheckedChanged(object sender, System.EventArgs e)
{
double Number1, Number2, Result;
try
{
Number1 = Convert.ToDouble(txtNumber1.Text);
Number2 = Convert.ToDouble(txtNumber2.Text);
Result = Number1 / Number2;
txtResult.Text = Result.ToString();
}
catch(System.FormatException fmtE)
{
MessageBox.Show(fmtE.Message);
}
}
}
|