I have a Form which has an “Ok” Button that is assigned as AcceptButton. When I click this Button or press Enter key the Form is automatically closed, as expected.
Under the event OkButtonClick I wrote a routine to check if all the fields were correctly filled, case not an error message is thrown through a MessageBox. The problem is that after close the MessageBox the Form is automatically closed, but I would like it remains opened to allow user to correct his inputs. In this case, how should I do to prevent that Form was closed?