Question about MDI-Child Closing events

F

Franky

The Closing event is broadcast by the multi-cast delegate which sends the
event to all subscribed delegates.

I wonder if the MDI container receives this event and then sends one to each
MDI-Child

or is each child a subscriber to the first event mentioned here?



Anyone know?



Thanks
 
D

Dave Sexton

Hi,

Just curious?

An MDI container is just an instance of Form and so is its children. Also,
an MDI container has a reference to each of its children. Now I don't know
what the actual implementation is, but all the container needs to do in the
event that it's being closed is to iterate over its child forms collection
and invoke the OnClosing method on each.

(Note: the FormClosing event should be handled by custom code in the 2.0
Framework instead of Closing).
 
N

Nicholas Paldino [.NET/C# MVP]

Franky,

The MDI container does not auto-subscribe to the event and then notify
every MDI child that another form is closing. You would have to wire that
up yourself.

Hope this helps.
 
F

Franky

thanks

Nicholas Paldino said:
Franky,

The MDI container does not auto-subscribe to the event and then notify
every MDI child that another form is closing. You would have to wire that
up yourself.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Franky said:
The Closing event is broadcast by the multi-cast delegate which sends the
event to all subscribed delegates.

I wonder if the MDI container receives this event and then sends one to
each MDI-Child

or is each child a subscriber to the first event mentioned here?



Anyone know?



Thanks
 
F

Franky

thanks

Dave Sexton said:
Hi,

Just curious?

An MDI container is just an instance of Form and so is its children.
Also, an MDI container has a reference to each of its children. Now I
don't know what the actual implementation is, but all the container needs
to do in the event that it's being closed is to iterate over its child
forms collection and invoke the OnClosing method on each.

(Note: the FormClosing event should be handled by custom code in the 2.0
Framework instead of Closing).
 

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