I have a little problem that my Form gets stuck when I run this first code. I have a lot of code in the event.
The code runs fine but if I now will deactivate the form by clicking with the mouse on the desktop and again click somewhere on the form, the form will "Not respond" and this goes on for about 3 minutes.
// 200 pages of code Application::DoEvents(); Form2::Update();
Now if I show a MessageBox in the end of the code, click OK, click on the desktop and again clicking on the form, everything works fine and the form respond as it should and doesn´t get stuck.
I dont know why everything works nice when I show a MessageBox. I started to think that I updated the form in somehow by doing that.
This is why I tried Applicaton:: DoEvents() and Form2::Update() in the above code.
I wonder if there would be any other code that fix this like the MessageBox did, peheps some kind of update of the form was done when the messagebox was showed ?
// 200 pages of code MessageBox::Show("Finish");