Example #1
0
        private void editQuestionToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (questionListBox.SelectedItem == null)
            {
                MessageBox.Show("Select question for editing.");
                return;
            }
            selectedQuestion = (Question)questionListBox.SelectedItem;

            editForm = new EditQuestion();
            editForm.Show();
            editForm.PopulateData(selectedQuestion);
            editForm.QuestionUpdated += new EventHandler(this.EditForm_QuestionUpdated);
        }
Example #2
0
        private void questionListBox_DoubleClick(object sender, EventArgs e)
        {
            if (questionListBox.SelectedItem == null)
            {
                return;
            }

            // get the selected question from the list box
            Question selectedQuestion = (Question)questionListBox.SelectedItem;

            // create a new edit form
            editForm = new EditQuestion();

            // show the form and set it to show details of the selected question
            //Wire the event handler
            editForm.Show();
            editForm.PopulateData(selectedQuestion);
            editForm.QuestionUpdated += new EventHandler(this.EditForm_QuestionUpdated);
        }