private void btStart_Click(object sender, EventArgs e) { try { if (radioH.Checked == true) { ComputeHmax(txtPath.Text); //Call the ComputeHmax method if the selected radio button is 'maximum depth' } else { ComputeVmax(txtPath.Text); //Call the ComputeVmax method if the selected radio button is 'maximum speed' } } catch (FileNotFoundException FEX) { MessageBox.Show(FEX.Message, FEX.GetType().Name); //Report a 'File Not Found' error, if any } catch (Exception EX) { MessageBox.Show(EX.Message, EX.GetType().Name); //Report other errors, if any } }