471,570 Members | 1,716 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,570 software developers and data experts.

MdiParent to fire event on adding/removing a MdiChild

Hi,

I wounder if someone could help me here: app has an MdiParent form - i
need to get some notification in form of an event when any MdiChild
forms are added to/removed from MdiParent.MdiChildren collection. I have
no control over children forms so i peed the parent form to fire this
event.

I didn't find any events of Form that would handle that.
Any ideas would be highly appreciated!

Thank you,
MuZZy
Dec 15 '05 #1
3 2996
Hi MuZZy,

As far as I know, there is no event fired when you add a child form to an
MDI parent form. However, when you make a child form to be the MDIChild of
the parent form, you will always need to call childForm.MdiParent =
parentForm;

So in this case, you can do whatever after this line of code.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Dec 15 '05 #2
Kevin Yu [MSFT] wrote:
Hi MuZZy,

As far as I know, there is no event fired when you add a child form to an
MDI parent form. However, when you make a child form to be the MDIChild of
the parent form, you will always need to call childForm.MdiParent =
parentForm;

So in this case, you can do whatever after this line of code.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."


Well, i actually found an answer for that: When you set the from as
MdiParent, it adds a MdiClient object to that form. This object is
responsible for managing Mdi Child forms and it has events
ControlAdded/ControlRemoved which fire whenever an MdiChild is added
to/removed from parent Form.MdiChildren collection

I tried and it works just fine

Andrey
Dec 15 '05 #3
Hi Andrey,

Thanks for sharing your experience with all the people here. If you have
any questions, please feel free to post them in the community.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Dec 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Duncan | last post: by
1 post views Thread by Roy | last post: by
2 posts views Thread by thorgal | last post: by
reply views Thread by lumer26 | last post: by
reply views Thread by lumer26 | last post: by
reply views Thread by lumer26 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.