We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Forms refuse to action on close requests

Occasionally I get Winform apps which refuse to react to a close request - either via the close cross at the top right of the form or a programmatic Form.Close() method call. The scenario is rare but does happen often enough to be a pain to users. The only recourse for users is then to kill the app with the task manager. Have the Syncfusion staff experienced this behaviour? Is it a Winforms bug or does it typically occur as a result of an app programming error? If it''s the latter, how can you track down what code is causing the problem?

2 Replies

AD Administrator Syncfusion Team February 29, 2004 02:00 AM

Off my head, this is caused by bug in Windows Forms. The reason is that somewhere there is a control that got invisible while keeping keyboard focus. Actually Windows Forms tries to Validate control and fails, and then refuses to Close form. Usually, this happens when you have a panel and you show/hide it following application logic. Solution would be focusing another, visible control before hiding panel, for example navigation pane or status bar.


AD Administrator Syncfusion Team March 10, 2004 03:34 PM

orangy is right-on, I''ve had to deal with this in the past as well. In addition to the panel situation described, it can also occur if the focus is on a control in a tabpage, then you remove the tabcontrol from the form programmatically.

Loader.
Live Chat Icon For mobile
Up arrow icon