M
Mark Rae
Hi,
I have a very simple MDI application where the MDI Container form has an
even simpler MainMenu. I want to disable a couple of the menu items if there
are no MdiChild windows open.
I had thought that a good way to do this would be to place code behind the
Load and Closed events of the child form to interrogate the
this.MdiParent.MdiChildren.Length
property. However, although this returns the correct value in the Load
event, it doesn't in the Closed event. According to the docs, a form's
Closed event fires *after* the form has closed, e.g., even if I close the
last child form, the MdiChildren.Length property of the MDI Container form
still gives me a value of 1.
Is there a better way of doing this?
Any assistance gratefully received.
Best regards,
Mark Rae
I have a very simple MDI application where the MDI Container form has an
even simpler MainMenu. I want to disable a couple of the menu items if there
are no MdiChild windows open.
I had thought that a good way to do this would be to place code behind the
Load and Closed events of the child form to interrogate the
this.MdiParent.MdiChildren.Length
property. However, although this returns the correct value in the Load
event, it doesn't in the Closed event. According to the docs, a form's
Closed event fires *after* the form has closed, e.g., even if I close the
last child form, the MdiChildren.Length property of the MDI Container form
still gives me a value of 1.
Is there a better way of doing this?
Any assistance gratefully received.
Best regards,
Mark Rae