PDA

Click to See Complete Forum and Search --> : keeping an mdi child on top


craig_phillips2
Jan 24th, 2001, 07:20 AM
how do i keep an mdi child form on top of other mdi children. I have tried the api setorder function and it didn't work.

The thing i have is two froms side by side. one is a menu form and the other is a status form. however, they are joined and are supposed to look like one and a part of the mdi form. from the menu form you can load a dialog window for doing some tasks. this window is indipendant from the others. but when you click on the mdi form behind, it brings forward only one of the two other child forms hiding half of the dialog form. it looks very cheep and un professional.

i have also tried making them as independant forms (not children) and hiding the task bar entry. but there is a bug in VB and when you call the message box function, the form is hidden while the message is displayed, then the dialog is displayed again. this makes the screen flash and looks rubbish.

If you have any suggestions on how to stop the other forms coming in fron of my dialog forms or how to stop the message box hiding the dialog then your more then welcome.

help!

cheers
Craig

Babbalouie
Jan 24th, 2001, 09:46 AM
You can try setting the ZOrder property of the forms to the order you want them displayed...

Jan 24th, 2001, 10:20 AM
Try this:


Private Sub MDIForm_LostFocus()
ZOrder
End Sub

craig_phillips2
Jan 26th, 2001, 05:22 AM
the mdi form dows not have the lost focus event

the mdi form never loses focus either because the forms are children to the mdi.

cheers
craig

craig_phillips2
Jan 26th, 2001, 05:38 AM
zorder problem

i tried the zorder method but the trouble is i have to put it on the listbox getfocus event because the actual sidebar form get focus doesnt work because focus is instantly transferred to the list box.

this list box is used when double clicked to restore the minimised child window. however, because the zorder method is in the getfocus, the child window is restored but then hidden because the zorder method is called.

how can i get round this problem?

i've attatched the sidebar form here