在TableLayoutPanel中移动行

Raz*_*iel 5 windows-forms-designer visual-studio winforms visual-studio-2012

我不知道如何TableLayoutPanel在设计器中移动一行。你是怎样做的?

我无法拖动它们,没有按钮可以上下移动它们,而将所有控件从一行移到另一行只是繁琐且耗时的。

Car*_*rra 6

要在设计器中完成此操作,需要使用第三行,即要交换第1行和第2行。

  • 添加一个空行3。
  • 从第1行>第3行移动控件
  • 将控件从第2行>第1行移动
  • 从第3行>第1行移动控件
  • 删除第3行

是的,这是一种解决方法,但可以完成工作。

或者,您可以在designer.cs文件中更改代码。您可以在此处更改以下内容:

this.myTableLayout.Controls.Add(this.myLabel1, 0, 0);//Change the order of these items.
this.myTableLayout.Controls.Add(this.myLabel2, 0, 1);
Run Code Online (Sandbox Code Playgroud)