Order in which controls are docked

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
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.
 
Back
Top