Divil
Well-known member
- Joined
- Nov 17, 2002
- Messages
- 2,748
No, but your code could be better. I dont understand why youre trying to hide an MDI Child form that is losing the focus. That doesnt make any sense to me. Under normal MDI operations, the parent MDIChildActivate will fire when the focus changes from one MDI Child to another, or when the last child is closed.
You dont have to have an array of names to check which form is the active one, instead you can use the Is operator to check object equality:
If you really must hide a child that goes out of focus, you could perhaps try the BeginLayout and EndLayout methods of the parent form, to indicate youre performing a multi-step operation and it shouldnt redraw or raise certain events.
You dont have to have an array of names to check which form is the active one, instead you can use the Is operator to check object equality:
Code:
If Me.ActiveMDIChild Is frmObjectArray(1) Then
If you really must hide a child that goes out of focus, you could perhaps try the BeginLayout and EndLayout methods of the parent form, to indicate youre performing a multi-step operation and it shouldnt redraw or raise certain events.