Order in which controls are docked

G

Guest

I have a form with several panels. Each of these panels need to be docked to
the top in a specific order. I am having problems getting the panels to dock
in the correct order (i.e. panel1 needs to be at the top, panel2 needs to
dock just below panel1, panel3 needs to dock just below panel2, etc.). If I
undock everything, dock panel1 to the top, then dock panel2 to the top,
panel2 will show up above panel1--reversing the order in which I dock the
controls doesn't seem to have any effect. So...what determines the
precedence of the docked controls?
 
H

Herfried K. Wagner [MVP]

Brandon said:
I have a form with several panels. Each of these panels need to be docked
to
the top in a specific order.

Dock order is determined by the controls' Z-index. Check out the "Bring to
front" and "Send to back" context menu entries in the Windows Forms
designer. You can change the Z-order at runtime by calling the control's
'BringToFront'/'SendToBack' method.
 

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