471,078 Members | 792 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,078 software developers and data experts.

Parent MDI and User Control Issue

Ian
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.
Nov 22 '05 #1
1 2033
CMM
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).

"Ian" wrote:
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.

Nov 22 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Ian | last post: by
1 post views Thread by Danny Ni | last post: by
5 posts views Thread by Steve Richter | last post: by
5 posts views Thread by Josh Nikle | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.