private void AddQuestionButton_Click(object sender, EventArgs e) { this.Hide(); var questionForm = new QuestionForm(this); questionForm.Show(); }
private void EditQuestionButton_Click(object sender, EventArgs e) { try { var id = GetSelectedQuestionNumber(); Question question = Dao.GetQuestionByNumber(id); this.Hide(); var questionForm = new QuestionForm(this, question); questionForm.Show(); } catch (Exception exception) { MessageBox.Show(@"Cannot extract selected question", @"Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }