I have a dialog that I show with .ShowDialog(). It has an OK button and a Cancel button; the OK button also has an event handler.
.ShowDialog()
I want to
Use this code:
private void btnOk_Click(object sender, EventArgs e) { if (ValidateControls()) this.DialogResult = DialogResult.OK; }
The problem of it is that the user has to clic two times the buttons for closing the forms;