Link to home
Start Free TrialLog in
Avatar of WinterMuteUK
WinterMuteUKFlag for United Kingdom of Great Britain and Northern Ireland

asked on

How to inform one form that another has ended...

I have 2 forms:
form1, form2.

form1 creates a new instance of form2 in the standard way, I want form1 to perform a method when form2 closes, but how do I inform form1 that this has occured and to go ahead and start the method?

ASKER CERTIFIED SOLUTION
Avatar of astankovic
astankovic

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of WinterMuteUK

ASKER

How do I return a 'DialogResult.OK' value?

Currently I have it set up:

01.  if (dlg.ShowDialog() == DialogResult.OK )
02.  {
03.      MessageBox.Show("Got Here (1)");
04.  }
05.  MessageBox.Show("Got Here (2)");

And if I place a break point on line 03 the code shows the form, and when I close the form (using this.Close();) it just skips to line 05.

Thanks again.

Me.
Right,

Found it, if I set the DialogResult property of the buttons on the form!

Thanks for the help

Me.