I can't figure out how to move a row of the TableLayoutPanel
in the Designer. How do you do that?
I cannot drag them, there are no buttons to move them up or down and moving all the controls from one row to another is just tedious and time consuming.
To do it in the designer, you need a third, empty row to use, let's say you want to swap row 1 and row 2.
Yes, it's a workaround but it gets the job done.
Alternatively, you can change your code in the designer.cs file. There you can change the following:
this.myTableLayout.Controls.Add(this.myLabel1, 0, 0);//Change the order of these items.
this.myTableLayout.Controls.Add(this.myLabel2, 0, 1);
If your TableLayoutPanel
's child controls are not docked (i.e., you can drag them around), you can simply drag each control from your first row to the corresponding cell in the second. The Windows Forms designer will then swap the controls for you, since you can only have one control in each cell. This tip can also be found on MSDN.
It's still not ideal, but at least you don't have to create or remove rows with this method, nor manually edit the designer code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With