需要帮助跟踪一个奇怪的问题的由来 [英] Need help tracking the origin of a weird problem

查看:95
本文介绍了需要帮助跟踪一个奇怪的问题的由来的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的一个应用程序与数据库的工作。每当我创造我的应用程序多个数据表中,然后删除一个,然后尝试关闭应用程序,也不会关闭。我添加了一个事件处理程序的FormClosing 事件和取消属性 FormClosingEventArgs 。如何跟踪这哪里是属性被设置为

I'm working on an app that works with databases. Whenever I create more than one data table in my app, then erase one, and then try to close the app, it won't close. I added an event handler to the FormClosing event, and the Cancel property of FormClosingEventArgs is true. How can I track where is this property being set to true?

推荐答案

本方案通常是由被卡在验证表单上的控件之一造成的。如果你正在处理的任何控制确证事件,并设置 e.Cancel = TRUE 在处理该事件,那么初始值取消财产的处理程序的FormClosing 也将是

This scenario is usually caused by one of the controls on your form being stuck in validation. If you are handling the Validating event on any controls and you set e.Cancel = true in the handler for that event, then the initial value of the Cancel property in the handler for FormClosing will also be true.

如果,一次偶然的机会,你的数据库的应用程序正在使用的DataGridView 控制,其中一个单元格仍可能在编辑模式下,当你来到关闭的形式。

If, by chance, your database app is using a DataGridView control, one of the cells may still be in edit mode when you come to close the form.

这篇关于需要帮助跟踪一个奇怪的问题的由来的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆