We have an application running at a client that is displaying strange behavior. At random times during the day the OK button (which calls the Form.Close method) on certain forms will not cause the Form to close. With that I mean that the user will click the button, in the trace it will display that Form.Close was called but the form will not close.
The strange thing is that the Form itself is still responsive so they can click any button on the form and the code behind the buttons will execute but the form just will not close.
This state lasts for anything between a couple of seconds to a couple of minutes. Then all of a sudden the form will start disposing and disappear. Really strange.
So to recap, the following happens:
Form.ShowDialog()
-> The form displays- User works on form and presses buttons and so forth
Form.Close()
is called -> The user clicked the close button- An amount of time passes where the form is just waiting to close while still being responsive (In this time the frustrated user hammered the close button a couple of times with no response)
- All of a sudden the form disposes and a dialog result is returned from the
Form.ShowDialog
Things to note:
- I'm not using any type of threading.
- At certain times it is reported that the
explorer.exe
process has stopped on the PC, can this have an impact on a form's behavior? We are scheduling a rebuild of the PC.
My question is if anyone is aware of a scenario that can cause the described behavior above?
I'm not an expert at Forms but as I understand it, when you call Form.Close
, the form doesn't close instantly, the current method that called Close first finishes and then another process triggers the form to start closing and dispose.
Can this be related to the explorer.exe
process not running?
Any insight would be greatly appreciated.
*** Edit
Also note that we can't replicate the issue, it happens randomly at the client.