private void questionListBox_MouseDoubleClick(object sender, MouseEventArgs e) { if (questionListBox.SelectedItem == null) { return; } selectedQuestion = (Question)questionListBox.SelectedItem; detailForm = new QuestionDetails(); detailForm.QuestionUpdated += new EventHandler(this.QuestionDetailForm_QuestionUpdated); detailForm.Show(); detailForm.ViewQuestion(selectedQuestion); }
private void questionListBox_DoubleClick(object sender, EventArgs e) { if (questionListBox.SelectedItem == null) { return; } selectedQuestion = (Questions)questionListBox.SelectedItem; updateForm = new QuestionDetails(); updateForm.QuestionUpdated += new QuestionEventHandler(this.UpdateForm_QuestionUpdated); // takes this from the detailForm instance (QuestionDetails class) to populate data updateForm.PopulateData(selectedQuestion); // opens and shows the detail form upon a double click of a listbox item updateForm.Show(); }
private void editToolStripMenuItem_Click(object sender, EventArgs e) { if (questionListBox.SelectedItem == null) { MessageBox.Show("Add a question or load a file first"); return; } selectedQuestion = (Questions)questionListBox.SelectedItem; updateForm = new QuestionDetails(); updateForm.QuestionUpdated += new QuestionEventHandler(this.UpdateForm_QuestionUpdated); // takes this from the detailForm instance (QuestionDetails class) to populate data updateForm.PopulateData(selectedQuestion); // opens and shows the detail form upon a double click of a listbox item updateForm.Show(); }
private void addToolStripMenuItem_Click(object sender, EventArgs e) { detailForm = new QuestionDetails(); detailForm.Show(); detailForm.QuestionAdded += new EventHandler(this.QuestionDetailForm_QuestionAdded); }