Jump to content

always on top


Recommended Posts

i want to make my main form always on top but have all child dialogs and forms and message boxes always on top of the main form

ive got all my child forms/dialogs set to top most but if i set topmost for the main form then its what ever is active thats on top

anyone know how to make children always ontop of the parent regardless of parents settings? or are there any z-index type parameters around?

Link to comment
Share on other sites


If you are planning this for your editor please put toggle to turn this behavior off... many people find it extremely annoying.

In answer to question, try making main form "IsMdiContainer" true, then when launching child form, set MdiParent to main form. I.E.

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
    Form2.MdiParent = Me
    Form2.Show()
End Sub

Link to comment
Share on other sites

I tried that and it didn’t work, though is an mdi container not a window that opens all windows within the main window and can’t be moved outside it? Because I don’t want to do that

what’s I am trying to do is make the main form "second from top" more like so other things that are topmost such as dialogs and such are always on top but the main form is always on top of other apps though it doesn’t seem to be possible

Link to comment
Share on other sites

Yes that is MDI Container. All child forms contained in main form. Visual Foxpro has a property "Desktop" to allow you to move child forms outside of the main window, but I haven't found equiv for .NET.

I think "AddOwnedForm" may be closer to what you want then. Like the find box in notepad that is not modal but floats over the main form? That is what you are going for I guess.

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
   Me.AddOwnedForm(Form2)
   Form2.Show()
End Sub

Edited by dman
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...