Having derived forms recognizing the docking property of objects in the base form

M

moondaddy

I have a base form where I docked a panel control across the header to act
as a custom menu/tool bar. If I were to dock another control in the base
form to the left side, it would recognize the first panel docked on the
header, and therefore the 2nd panel would stretch from the bottom of the
form to bottom of the 1st panel (1st panel being the one docked to the top
which stretches from the left to the right side of the form). Ok that all
works as expected. now I remove the 2nd panel from the base form as it was
just a test to see that the docking was working correctly.

Now I build the project and go to a form that's derived from this base form
and I dock a control to the left side of the form. Instead of this
left-docked control stretching from the bottom of the header panel (which is
part of the base form and docked on top) to the bottom of the form, it
stretches all the way to the top of the form and overlays my custom header
(which is part of the base form).

Is there anyway to change this behavior for a control docking in a derived
form and recognizing the docking of a control in the base form?

Thanks.
 
G

Guest

It sounds like the order of your panels is getting confused. Docked controls
determine their layout by their order in their container. Typically, if
docked controls are ovelapping when they shouldn't, you can fix it by
reordering the controls. Try calling the following after InitializeComponent
in theour derived constructor.
Controls.SetChildIndex( <your left panel>, 0 );
 
J

Jeffrey Tan[MSFT]

Hi moondaddy,

This is a by design issue. It is because the control you added in inherited
form has a deep z-order than base form. You can just right click the
contorl on inherited form and select BringToFront command. All will work
well.

Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 

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