I have investigated this further, and can confirm that I have not
implemented any Validating event code.
So, I am still left with the same question: What would cause e.Cancel to be
True on entry to the Closing event of an MDI child form.
As I stated before, I can set this to False on exit from the event, but that
only works when there is a child form open.
What seems to happen is that when there is no child form open, I cannot
close my app because Cancel is set to True - for some reason - and there is
no child form Closing event for me to set it False.
The scenario is this:
I start my app, which opens an MDI form.
I open an MDI child form and drag some user controls onto it.
I close the MDI child form.
The Closing event fires and e.Cancel is False on entry
I open another child form and drag some user controls onto it
I click the close button on the MDI _parent_ form
The Closing event fires for the MDI child form and e.Cancel is *True* on
entry
Can anyone suggest what could cause e.Cancel to be True in this situation?
This is a particular problem when I close the second MDI child form with its
close button. Then there are no child forms open, and when I click the close
button for the MDI parent form nothing happens. The form will not close,
because (I suspect) that it has Cancel set to True internally, and therefore
abandons the close immediately.
Charles