Adding controls to mdi forms

jgat2011

Member
Joined
Jul 2, 2011
Messages
13
Location
Nairobi-Kenya
Programming Experience
1-3
Hey,
I am developping a VB.net application. I would like to add buttons on the MDI but every time I open a child form of the MDI, it appears down the buttons. Is there any way I can solve this problem?
Thank you
 
I'll add a bit more detail that I didn't in that thread that JohnH linked to. When you set the IsMdiContainer property of a form to True, the system adds an MdiClient control to your form. The grey background is not the form itself, but rather that MdiClient control. There is no member variable for that control because you're not intended to access it directly, although you can access it via the form's Controls collection.

Now, if you add any other controls to the form, they must either be in front of the MdiClient (which they are by default) or behind it (in which case you wouldn't see them). If the MdiClient is behind the other controls then anything contained in the MdiClient, i.e. the child forms, will also be behind the other controls. You can't add anything but forms to the MdiClient, so your only other option is to do as I said in that other thread and use a Panel docked to one edge of the form to contain your other controls. It would be a seriously dodgy UI to have controls behind the child forms anyway.
 
Back
Top