I have two forms - Form1 and Form2
Form 1 :
Form1 has one button and form closing event.
on clicking on button a method will call form 2 and hides form 1
on closing the form1 the form1 closing event will do application.exit();
Form2 has one context menu with return to main form item - on clicking on this item a method will hide the form 2 and shows the form 1
Form2 also has a form closing event which also hides form 2 and shows form 1.
What am i doing:
I'm opening form 1 and then by clicking on the button i'm calling form 2. Form 2 shows up and Form 1 hides.
I'm right clicking on Form 2. The context menu shows Return to Main Form. I'm clicking on Return to Main Form item in the context menu. This is hiding the form 2 and showing the form 1. Now, i'm just closing the form 1. I'm getting exception error.
Note: This is not the case when i simply close form 2 and return to form 1 and then close form 1. No error.
View Complete Post