How to disable resizing of winform tablelayoutpanel?

33 views Asked by At

I have a winform with tablelayoutpanel and I would like to restrict its size when window is resized. Resizing the window resizes the controls as well and the structure gets distorted.

this.tableLayoutPanel1.ColumnCount = 2;
            this.tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
            this.tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
            this.tableLayoutPanel1.Dock = DockStyle.Fill;
            this.tableLayoutPanel1.Location = new Point(0, 0);
            this.tableLayoutPanel1.Name = "tableLayoutPanel1";
            this.tableLayoutPanel1.RowCount = 4;
            this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Percent, 10F));
            this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Percent, 10F));
            this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Percent, 35F));
            this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Percent, 45F));
            this.tableLayoutPanel1.Size = new Size(682, 598);
            this.tableLayoutPanel1.TabIndex = 0;
            //this.tableLayoutPanel1.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single;
            this.tableLayoutPanel1.Controls.Add(groupBox4, 0, 2);
            this.tableLayoutPanel1.Controls.Add(groupBox5, 1, 2);
            this.tableLayoutPanel1.Controls.Add(groupBox7, 0, 3);
            this.tableLayoutPanel1.Controls.Add(groupBox6, 1, 3);
            this.tableLayoutPanel1.Controls.Add(pictureBox1, 1, 0);
            this.tableLayoutPanel1.Controls.Add(label6, 0, 1);
            this.tableLayoutPanel1.SetColumnSpan(label6, 2);
            this.tableLayoutPanel1.AutoSize = false;

I tried using autosize = false

0

There are 0 answers