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?
I’m working on an app that works with databases. Whenever I create more than
Share
This scenario is usually caused by one of the controls on your form being stuck in validation. If you are handling the
Validatingevent on any controls and you sete.Cancel = truein the handler for that event, then the initial value of theCancelproperty in the handler forFormClosingwill also betrue.If, by chance, your database app is using a
DataGridViewcontrol, one of the cells may still be in edit mode when you come to close the form.