Order in which controls are docked

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Brandon

    Order in which controls are docked

    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?

  • Herfried K. Wagner [MVP]

    #2
    Re: Order in which controls are docked

    "Brandon" <Brandon@discus sions.microsoft .com> schrieb:[color=blue]
    >I have a form with several panels. Each of these panels need to be docked
    >to
    > the top in a specific order.[/color]

    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.

    --
    M S Herfried K. Wagner
    M V P <URL:http://dotnet.mvps.org/>
    V B <URL:http://classicvb.org/petition/>

    Comment

    • Brandon

      #3
      RE: Order in which controls are docked

      Works like a champ. Thanks.

      Comment

      Working...