Solved the problem, just curious really

M

Michael Culley

I have an MDI application that was occasionally refusing to close. When clicking on the cross at the top right the app would just
not do anything and the only way to close it was to terminate it. The problem ended up being that in the Form_Closing event had
e.Cancel = True even though I've not set it to true (it took a while to find because it only ever happened once in the IDE). Setting
it to false fixed the problem. I've done a fair bit of searching and this problem has been encountered by many people but I couldn't
find any real solution. Most people reported that the closing event never fired but in my case it did. Does anyone know anything
about this?
 
M

Matt Garven

Try turning "break on exception" on.

Is your child form performing anything during the Validating event? Your
problem rings a bell (softly, distantly) about a similar problem I had with
this.

Not much more comes to mind without seeing more of what you're doing :)

Regards,
Matt

Michael Culley said:
I have an MDI application that was occasionally refusing to close. When
clicking on the cross at the top right the app would just
not do anything and the only way to close it was to terminate it. The
problem ended up being that in the Form_Closing event had
e.Cancel = True even though I've not set it to true (it took a while to
find because it only ever happened once in the IDE). Setting
it to false fixed the problem. I've done a fair bit of searching and this
problem has been encountered by many people but I couldn't
find any real solution. Most people reported that the closing event never
fired but in my case it did. Does anyone know anything
 
M

Matt Garven

Go to your Debug menu, choose "Exceptions...", select "Common Language
Runtime Exceptions" then select "Break into the debugger".

Regards,
Matt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top