private void startButton_Click(object sender, EventArgs e) { string firstOperand = textBox1.Text; string secondOperand = textBox2.Text; string thirdOperand = textBox3.Text; try { var newSum = new SumAlgorithm(); newSum.calculateSum(Int32.Parse(firstOperand), Int32.Parse(secondOperand), Int32.Parse(thirdOperand)); } catch { MessageBox.Show("Invalid input."); } }