1
votes

If I set up two forms, I can close one or the other by using the ".Close()" function on the form's handle. However, this does not work on Mdi Forms. The child form never seems to lose focus by clicking on any other child or the parent since the forms are all children of the parent. As long as the parent has focus, then children also have focus.

Is there a way to determine if the child form has lost focus and if so close it?

I use this for my regular (non-Mdi) forms and it works great:

AddHandler sub_menu.LostFocus, AddressOf close_menu

Thanks.

1
Have you tried the Leave event handler?davidsbro
Yes, I tried that; no joy.John

1 Answers

0
votes

When a form gets the focus, close all the MDI child forms that are not the ActiveMDIChild of the parent form.