cancel
Showing results for 
Search instead for 
Did you mean: 

When Form Closes APP stop processing

Former Member
0 Kudos

Hello All:

I am very new at this, and this problem is very strange. I created a menu which opens a form. However when I close the form and try to open the form again, the menu no longer work. I debugged and found the process is still running hoewver the event handler doesn't seem to pickup any new evens. I have three even handling, appevent, itemevent, menuevent. After the form close non of the event respond. But the process stil running. Has anyone also see this kind of problem? Thank You!

oh and my main function does have

System.Windows.Forms.Application.Run() repeating the run. if I don't open and close any form. This works great. But as soon as I close form all even stop handling. Doesn't it have something to do with different threas?

Message was edited by: Bo Peng

Accepted Solutions (1)

Accepted Solutions (1)

former_member184566
Active Contributor
0 Kudos

Hi Bo Peng

The reason for this happening is that somewhere along the way, somwhere where between opening the form, anything done on the form and closing it an error has occured. That is what causes this. Has all your code pieces got exception handling (try blocks). Put this around all your code and obviuosly display the error, see if any error occurs.

Another thing, is your events procedure headings written correctly??

Hope this helps

Answers (1)

Answers (1)

Former Member
0 Kudos

Event handling and it's parameter is correct. I think, because it handles everything fine until the form got closed. But the try and catch thing is definitly sounds interesting. I will give it a try, there are just couple of things that I don't have try and catch for. But I will get it done to see if there are any unhandled exception out! Thank You!