private void btSelect_Click(object sender, EventArgs e) { try { bool isChecked = false; foreach (Control ctl in groupBox1.Controls) { if (ctl is RadioButton) { var aRadioButton = (RadioButton) ctl; if (aRadioButton.Checked) { isChecked = true; } } } if (!isChecked) { MessageBox.Show("Please select an option!"); return; } var form2 = new FrmFindPatient(); foreach (Control ctl in groupBox1.Controls) { if (ctl is RadioButton) { var aRadioButton = (RadioButton) ctl; if (aRadioButton.Checked) { switch (aRadioButton.Name) { case "rbUpdate": StaticVar = this; this.Visible = false; Hide(); form2.Show(); break; case "rbDelete": StaticVar = this; this.Visible = false; Hide(); form2.Delete = true; form2.Show(); break; } } } } } catch (Exception ex) { //var logger = new ExceptionLogger(); //logger.AddLogger(new EventLogLogger()); //logger.LogException(ex, "Menu selection failed!"); //throw new Exception(ex.Message, ex); } }
private void GoToFindPatient() { StaticVar = this; Hide(); this.Visible = false; this.IsExit = false; this.Close(); Application.DoEvents(); System.Threading.Thread.Sleep(400); var form2 = new FrmFindPatient(); form2.Show(); }