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(); }
private void button2_Click(object sender, EventArgs e) { this.DialogResult = DialogResult.Cancel; MDIParent1.Form3Close(this.DialogResult); this.Hide(); }