//This shows the AddAParentMessageBox form and if the user clicks 'yes', the SelectAParentForm will appear, if they click 'No', the AddAParentForm will appear private void childToolStripMenuItem_Click_1(object sender, EventArgs e) { using (var form = new AddAParentMessageBox()) { var result = form.ShowDialog(); if (result == DialogResult.Yes) { this.Hide(); new SelectAParentForm(db).Show(); } else if (result == DialogResult.No) { this.Hide(); new AddAParent(db).Show(); } } }
private void button1_Click(object sender, EventArgs e) { //This shows the AddAParentMessageBox form and if the user clicks 'yes', the SelectAParentForm will appear, if they click 'No', the AddAParentForm will appear using (var form = new AddAParentMessageBox()) { var result = form.ShowDialog(); if (result == DialogResult.Yes) { this.Hide(); new SelectAParentForm(db).Show(); } else if (result == DialogResult.No) { this.Hide(); new AddAParent(db).Show(); } } }
//If the add a child picture is clicked private void pictureBox2_Click(object sender, EventArgs e) { using (var form = new AddAParentMessageBox()) { var result = form.ShowDialog(); //If the user clicks 'Yes' if (result == DialogResult.Yes) { //The SelectAParentForm appears this.Hide(); new SelectAParentForm(db).Show(); } //If the user clicks 'No' else if (result == DialogResult.No) { //The add a parent screen appears this.Hide(); new AddAParent(db).Show(); } } }