If I call Close() in my WinForm, it seems that even though DialogResult is None at the time, right after I call Close() I see that it is set to Cancel.
Does this sound normal?
See Question&Answers more detail:osIf I call Close() in my WinForm, it seems that even though DialogResult is None at the time, right after I call Close() I see that it is set to Cancel.
Does this sound normal?
See Question&Answers more detail:osOr even easier, you can set DialogResult just after Close. For example, assuming ValidateSettings will show the user any problems with the form or return true otherwise:
private void btnOK_Click(object sender, EventArgs e)
{
if (ValidateSettings())
{
SaveSettings();
Close();
DialogResult = DialogResult.OK;
}
}