I have application of two forms (just created by AddNewForm)
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
Application.Run(new Form2());
}
When Form1 is closed by red cross in top-right corner Form2 is shown as expected.
When Form1 is closed by context menu "Close" shown on form icon in taskbar, application terminates almost immediately. In case Form2 is not shown following happens - its Load eventhandlers are processed, but its FormClosed eventhandlers are not called.
I observe this behavior only on Windows 10 (unable to simulate on Windows 7) and in approx. 80% cases. Any reason WHY?