Take the 2-minute tour ×

C# WinForms: I am designing my form and I have a couple of TableLauots. so I design my first tablelayout, throw it on the panel and set Dock->Top ... then I design my second one and do the same and set Dock->Top, it goes to Top again and good, it places under the previous one that was on top...I design the third one and set its dock.top and good it is under second one which is under first one...but I dunno what is the diffrence for the forth one that when I set its dock.top, it changes the order of the other three ones and get places some where in between them, it does not get placed under the third one...any idea what should I look in to?

share|improve this question
maybe I can use a big flow-layout and put all these inside that, but common! it should not be that complicated, who likes to add one more container to a form? Dock.Top should do it. –  Blake Jun 24 '11 at 21:43

4 Answers 4

up vote 16 down vote accepted

It depends on the order you have added those controls to their container. The earlier added control will be the topper one and so on ...

To fix it, "Cut" the forth control and "Past" it again to the container and it will take the desirable place.

Another way to fix it is by modifying the designer file code to re-order the adding of those controls to their container.

share|improve this answer
This is really a not good approach. "Bring Front" and "Send Back" option are way much better. for more details try this link. stackoverflow.com/questions/154543/… –  Adeem Jul 13 '11 at 8:50
The "Cut-paste" approach will destroy all callback bindings! –  YZ.learner Jul 29 '13 at 16:12

Right click on the Controls and select "Send to Back" or "Bring to Front", or use the Document Outline Window to rearrange the Z-Order of the items. Document Outline helps a lot when creating WinForms things with lots of controls.

share|improve this answer
This should be the accepted answer. Cutting and pasting will definitely screw up your design. –  Bart Friederichs Feb 6 at 11:36

The dock layout is based on the order they are added to the container.

I usually go to the *.Designer.cs file and modify the InitializeComponent() method to manually re-order how the controls are added to the container.


This order is opposite on display

share|improve this answer
"This order is opposite on display" should be in boldface. –  Jeffrey Goines Feb 9 at 4:26

You have to organize the order of your controls in the Document Outline window (VIEW -> Other Windows -> Document Outline (Ctrl+W, U)). Select your form in Desing Mode and you will see all your components in a tree view. Use the arrows on the top to select the desired order.

It is better than cut and past because it will avoid loss of binding callbacks.

share|improve this answer

Your Answer


