I have a VB.NET form which I'm displaying modally using the ShowDialog()
method.
Within the form is a Cancel button, and I've set this button into the Form's
CancelButton property so that pressing Escape automatically clicks the
button.
Within the button's Click event code I display a confirmation messagebox to
ensure the user really does want to cancel. However, regardless of what code
I put in this event, the dialog form always closes when the button is
clicked and the event code has finished executing. I've tried removing all
of the code from the event, and still clicking the button causes the form to
close.
Is there some way I can tell VB not to close the form if the user has
clicked "No" in the "Are you sure?" messagebox?
Many thanks,
--
(O)enone