private void EditQueForm_FormClosing(object sender, FormClosingEventArgs e) { if (this.DialogResult == DialogResult.Cancel) { return; } EditArticleForm.Сhek(MainBox, e); EditArticleForm.Сhek(RightCbox, e); EditArticleForm.Сhek(QuestionPoints, e); if (question.AnswerOptions.Count == 0) { e.Cancel = true; } }
private void ETF1_FormClosing(object sender, FormClosingEventArgs e) { if (this.DialogResult == DialogResult.Cancel) { return; } EditArticleForm.Сhek(NameBox, e); bool res = test.Questions.Count == 0; if (res) { OptionList.BackColor = Color.LightPink; e.Cancel = true; } else { OptionList.BackColor = Color.LightGreen; } }