MDI children Closing event firing order

M

Marius Groenendijk

Dear Group,

I have a MDI with children which may be editing data.
If a MDI child closes its Closing handler asks a question 'exit w/out
saving?'.
On closing the MDI its pops a question 'Exit app?'.

If the MDI closes *first* the questions asked by the MDI children appear
and *then* the question by the MDI. This is because the closing events in
the MDI children get fired *first* while Closing the MDI.

I would like this the other way around:

Exit app?
-> If no, don't bother asking the children (i.e. leave the app as is).
-> If yes, ask MDI children if they agree to close (exit w/out saving?)
If a child doesn't agree cancel closing.

Is there a way of achieving this?

TIA,
Marius.
 
G

Guest

Hi Marius

Application.Exit on the MDI parent form doesn't fire closing events on the
children. Me.Close on the MDI parent form will fire the closing events. So
that should sort you out!

HTH

Nigel Armstrong
 

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