Passing Event From One Form To Another

Phreak

Regular
Joined
Jun 7, 2002
Messages
62
Location
Iowa, United States
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.
 
Back
Top