MDI fixed child

  I am developing a windows MDI application. I have 3 child windows. Two of the windows
  can behave as any MDI child. But the third window,if open,  should  be  fixed   even when tiled or cascaded. The behaviour of this child window should be like a docking  window, but only thing is, the user should be able to close the window, if necessary.
    Thanking you,
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I don't think you can do this with an MDIChild form.

You might be able to replicate it - or get something approaching what you want - by putting a panel on the MDI parent form, docking it, and toggling its visibility to "open" and "close" it.

This worked for me in a quick test

        Panel1.Visible = Not Panel1.Visible

You can put in the panel whatever controls you wanted to put in the special form, but you will probably struggle to get exactly the same appearance.

Mike TomlinsonHigh School Computer Science, Computer Applications, Digital Design, and Mathematics TeacherCommented:
Add this code to the Child that you don't want to be moved around:

    Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
        Const WM_NCHITTEST As Integer = 132
        Const HTCAPTION As Integer = &H2

        If m.Msg = WM_NCHITTEST Then
            If m.Result.ToInt32() = HTCAPTION Then
                m.Result = New IntPtr(0)
            End If
        End If
    End Sub

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial

I stand corrected ;-)

Mike TomlinsonHigh School Computer Science, Computer Applications, Digital Design, and Mathematics TeacherCommented:

I wasn't sure it was possible at first either.  There are some of behaviours of Mdi Children that are simply imposed upon them and that you can't override without major heartache.  This change turned out to be the same as for normal forms.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.