Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,844 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello ,
i have used a tablelayout panel in my form and on its first row ,i have dragged a label control on it . i am trying to move it to the centre of the first row but its like stuck on the left side . how to move it to the centre of the row .
this is i having
and this is what i want (on the centre of first row and first column ) .
(the above screenshot i get , is by holding the label with the mouse cursor and then press the printscreen button)
// tableLayoutPanel3
//
this.tableLayoutPanel3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(184)))), ((int)(((byte)(224)))), ((int)(((byte)(184)))));
this.tableLayoutPanel3.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.Single;
this.tableLayoutPanel3.ColumnCount =4 ;
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F));
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F));
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F));
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F));
this.tableLayoutPanel3.Controls.Add(this.label5, 0, 0);
this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Bottom;
this.tableLayoutPanel3.Location = new System.Drawing.Point(0, 844);
this.tableLayoutPanel3.Name = "tableLayoutPanel3";
this.tableLayoutPanel3.RowCount = 2;
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20.69565F));
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 79.30435F));
this.tableLayoutPanel3.Size = new System.Drawing.Size(1227, 100);
this.tableLayoutPanel3.TabIndex = 7;
Try to select the label and set the Anchor property to None. (Remove the anchoring).