I have a windows form with multiple controls and OK and Cancel buttons. In the Click event handler of OK button, it checks to see if there are errors on the form. I need the form to stay open if there are errors. But the code below is not working. If there are errors, it is closing the form and returning to the caller. And I have the below two lines to invoke and show the form.
PtForm paymentForm = new PtForm();
Thanks for any help.
private void btnOk_Click(object sender, EventArgs e)
string ErrorString = GetValidationErrors();