Question

I have a form in a Pocket PC app that is set to be the Application form using:

Application.Run(New frmMain())

Somehow this form is getting closed for no reason while working on another form. No closing event is fired and nowhere in my code can you close the main form anyway. It is only closed by clicking the OK button at the top right of the window. When this is clicked, the user is prompted if he/she really wants to close the application. However, this is not occurring either.

Basically, I am on another form which adds a new record to the database. After adding the record the gotFocus event is somehow called for frmMain. When the code in the gotFocus event reaches a reference to a control on the form, there is an exception that states that the object is disposed.

When I bypass the code in the gotFocus event, the application just closes completely. I verify this by checking that it is not running in the device's memory.

I have been stepping through code for 2 hours and I have absolutely no idea why this could be occurring. Anyone possibly have a tip?

Was it helpful?

Solution

This sounds as an exception being raised anywhere. Maybe an exception on another thread? Look at the output window to see what it says.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top