1   public partial class UserControl1 : UserControl
 2     {
 3         public UserControl1()
 4         {
 5             InitializeComponent();
 6             this.tableLayoutPanel1.ColumnStyles[1].Width = 0;
 7         }
 8         //显示
 9         private void toolStripButton1_Click(object sender, EventArgs e)
10         {
11             this.tableLayoutPanel1.ColumnStyles[1].Width = this.tableLayoutPanel1.ColumnStyles[0].Width;
12             this.Refresh(); 
13         }
14       //隐藏
15         private void toolStripDropDownButton1_Click(object sender, EventArgs e)
16         {
17             this.tableLayoutPanel1.ColumnStyles[1].Width = 0;
18 
19         }
20     }

 

 this.tableLayoutPanel1.ColumnStyles[1] 为第二列  , 0为第一列

相关文章:

  • 2022-12-23
  • 2021-09-05
  • 2021-11-19
  • 2021-11-04
  • 2022-12-23
  • 2021-07-22
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-03
相关资源
相似解决方案