Ok, this is probably simple. But I want to be able to tell in my Main form, if the "Cancel" button on my login form is pressed. So that way, it doesn't do a bunch of junk in my main form since the user canceled the form.
Set the cancel button's DialogResult property to DialogResult.Cancel.
Then, when showing this form, call its ShowDialog method, which
returns a DialogResult. If the DialogResult returned from
ShowDialog is DialogResult.Cancel, then the user pressed Cancel.
You will probably want to change the other buttons on the
dialog form so their DialogResult properties act accordingly.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.