private void IssueDetail_FormClosing(object sender, FormClosingEventArgs e) { if (!CommentEdit.Visible) { if (SaveComment()) e.Cancel = true; } new WindowSettings(this).save(); }