Example #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if ((textBox1.Text != "") && (comboBoxCategories.SelectedIndex != -1) && (textBox4.Text != ""))
            {
                this.DialogResult = DialogResult.OK;
            }
            else if ((!TopicAndSubTopics) && (comboBoxCategories.SelectedIndex != -1) && (textBox4.Text != ""))
            {
                this.DialogResult = DialogResult.OK;
            }
            else
            {
                MessageBoxButtons buttons = MessageBoxButtons.OK;
                MessageBox.Show("Add a Category", string.Format("Please add a Topic, Category and SubTopics first."), buttons);
                return;
            }

            MDIParent1.Form3Close(this.DialogResult);
            this.Hide();
        }
Example #2
0
 private void button2_Click(object sender, EventArgs e)
 {
     this.DialogResult = DialogResult.Cancel;
     MDIParent1.Form3Close(this.DialogResult);
     this.Hide();
 }