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


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

9 Years
Discussion Span
Last Post by Lukezzz

Thank you, William Hemsworth

I appreciate that very much, the problem is that I cant ´give´ out this code.
However it seemed to be solved if I opened a new Form and closed it in the Load_event.
The whole process and solution seems strange and as I beleive for sure wrong solution but I will go with it for now and see if it works without problem.


Would you mind posting the entire project zipped (with unneeded compiler generated files excluded) so I can run it and take a closer look.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.