Close Main form in its constructor.
Posted on 2004-08-28
I have a MainForm acting as the starting form of my app. In Main(), it simply look like
static void Main()
In the constructor of FormMain, it look like:
//-----Because of some case, I need to exit my application here----
InitializeComponent(); // This call is required by the Windows Form Designer.
Why a small empty windows appears(my application doen't exit) when booNeedToExit=true?
How can I exit my application and release all resources in this case?