Parent MDI and User Control Issue

G

Guest

I have a parent MDI with a menu that calls all the children forms and that
works fine. My issue is I created a user control that looks like a toolbar
and it has various windows controls on it and it will be used by all of the
children forms. So I put the user control right underneath the menu control
on the parent. Anytime I call a child form it fills the parent area
including the area that the user control resides in. So I see the user
control still but the beginning of the child form sits underneath the user
control and I can't see the top part. I tried fiddling with the
startposition and location and nothing seems to work so that the children
forms will fill the parent area from the end of the user control to the
bottom of the parent area.

Any suggestion would be appreciated.
 
G

Guest

1) Set the user control's Dock property to top.

2) If you're trying to resize or position MDIChildren in code... it's
tricky... the trick is to get a reference to the magical "MDIClient" control
that is part of the MDIParent's controls collection and use its coordinates
as a reference point to layout your child windows. Do a search on Google for
MDI and MDIClient. If you get stuck I can post some code. It would be nice if
there was an equivalent to VB6's ScaleHeight/ScaleWidth properties
(GetClientRectangle doesn't cut it in a lot of circumstances).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top