MdiParent to fire event on adding/removing a MdiChild

  • Thread starter Thread starter MuZZy
  • Start date Start date
M

MuZZy

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
 
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."
 
Kevin said:
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
 
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."
 
Back
Top