0

hi
in my project i build a parent mdi which contains some labels, text and buttons and also a child mdi. when i run the program initially everything is okkk. but on opening the child mdi , the labels,buttons and text of parent mdi, are also visible on the child mdi. i used the enabled and visible in parent mdi but that close the whole program.
any sugestion plzzzz

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by Geekitygeek
0

The problem you are having is related to how MdiParent forms are handled.
When you set the isMdiContainer property to true it creates an MdiClient control on the form. This control is docked to fill the form and set behind all the other controls.
Whenever you add a child form it is placed inside this control (not on the form as you might expect). So the other controls are kept in front of the child form.

One workaround for this is to loop through all the forms controls at load to find the MdiClient control. You can then unset its docking and resize it. If you put your MdiParent's controls (the labels, textboxes, etc) in an area at the top of the form and size the MdiClient to fill whats left then the child forms will only be able to occupy the unused space.

Generally, if im using an Mdi form the MdiContainer only has a menustrip at the top and status bar at the bottom. Any other controls i want i place in child forms.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.