Click here to Skip to main content
14,359,217 members
Rate this:
Please Sign up or sign in to vote.
See more:
public partial class EntryPass : Form
   public EntryPass()
   ActionForm af = new ActionForm();
   private void EntryPass_FormClosing(object sender, FormClosingEventArgs e)
      bool cancel = true;
      if (MessageBox.Show("Do You Really Want to Quit?", "ExitWindow", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
         cancel = false;
   e.Cancel = cancel;

I want that, when I close EntryPass form then it Activate the ActionForm (since it is already open). So for this I code as above, but when I run this code, I am getting this exception
"stackoverflowexception" in the line:
ActionForm af = new ActionForm();

Please help me...
Updated 26-Mar-12 5:26am
Shahin Khorshidnia 26-Mar-12 10:20am
No, this code doesn't cuase any exception.
I think the exception is because of another parth of the application.
woopsydoozy 26-Mar-12 14:49pm
Looks OK--what's happening in the constructor/FormLoad of ActionForm?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100