B
BobRoyAce
I have a form that I show as a dialog (i.e. Form.ShowDialog). On this
form I have two buttons: one with a DialogResult of OK, and the other
with a DialogResult of Cancel. However, if the user clicks on the one
with a DialogResult value of OK, and something's wrong with data they
enetered on the form, I want to show a message and cancel the closing
of the form? Is there a way, in the Click event for the button, to say
"Hey, by the way, don't close the form!" I am thinking that I could
just set the DialogResult of the button to None and then set it to OK
if all is well. Is that the best way to do this?
form I have two buttons: one with a DialogResult of OK, and the other
with a DialogResult of Cancel. However, if the user clicks on the one
with a DialogResult value of OK, and something's wrong with data they
enetered on the form, I want to show a message and cancel the closing
of the form? Is there a way, in the Click event for the button, to say
"Hey, by the way, don't close the form!" I am thinking that I could
just set the DialogResult of the button to None and then set it to OK
if all is well. Is that the best way to do this?