Questions tagged [tablelayoutpanel]

A Winforms control that allows the dynamic addition of components which are arranged in a grid pattern using columns and rows.

The dynamic nature of the TableLayoutPanel allows columns and rows to be added at run time. This also means that the TableLayoutPanel will resize if the parent control's size changes.

495 questions
5
votes
2 answers

TableLayoutPanel: Can't get content rows to size correctly

I am using a TableLayoutPanel to split a client area into 3 rows (there is only 1 column). The top and bottom rows are designed to be of fixed height; they will contain a header and a footer which initially each contain a child label control that…
Plastikfan
  • 3,674
  • 7
  • 39
  • 54
4
votes
3 answers

C# change location of controls inside FlowLayoutPanel

I am using flowLayoutPanel to have relative location controls. I would like to change the location of control inside the flowLayoutPanel. when I say location, I dont mean control1 before control2 or something like that - I mean that if I got 2…
Ron
  • 3,975
  • 17
  • 80
  • 130
4
votes
4 answers

TableLayoutPanel's Control Columns properties

I've noticed that every control added to the TableLayoutPanel is given "Column" and "Row" properties. How can I get access to these properties through code? thanks:)
Idov
  • 5,006
  • 17
  • 69
  • 106
4
votes
1 answer

Winforms MVP Pattern w/ Multiple Views

I recently created a winforms application that followed no specific design pattern. This application has 4 different "views", each implemented using a TableLayoutPanel. One view is a "main" view that allows the user to select input files and the…
j.castillo
  • 88
  • 1
  • 8
4
votes
2 answers

Center a Panel within a Panel, which is in a TableLayoutPanel, in C#

So basically I've got a game board going, represented by a TableLayoutPanel. Each cell of the TableLayoutPanel represents a space on the board and contains a Panel. Each Panel has a Label in it to display what is currently in that space (e.g. a…
Nick08
  • 157
  • 1
  • 2
  • 10
4
votes
1 answer

TableLayoutPanel isn't showing padding on bottom when scrollbar is visible

I'm trying to build "dashboard" like layout for my WinForms application. I was able to build simple concept using TableLayoutPanel. I'm able to add columns, rows and controls to tlp (TableLayoutPanel), but I get unwanted behaviour: I have padding…
Misiu
  • 4,738
  • 21
  • 94
  • 198
4
votes
1 answer

Adding rows to top of TableLayoutPanel

I'm trying to add new rows to my tablelayoutpanel at the top of it. For that purpose I use the following code: Initialization TableLayoutPanel panel = new TableLayoutPanel(); panel.ColumnCount = 1; panel.RowCount = 1; panel.AutoScroll =…
Aldridge1991
  • 1,326
  • 6
  • 24
  • 51
4
votes
1 answer

Flowlayout panel and autosizing child controls doesn't work

I am trying to get a very simple autosizing layout on a winform (C# .NET). I've tried TableLayoutPanels and FlowLayoutPanels but nothing works. I have a usercontrol which is a container for other usercontrols which are created at runtime - I've…
Pete
  • 41
  • 1
  • 2
4
votes
0 answers

How to prevent tearing when scrolling TableLayoutPanel?

I think vertical tearing is the proper term to describe what I'm seeing but here is an screenshot that shows the issue: I thought the DoubleBuffered property could help with this but it neither setting it on my Form or inheriting TableLayoutPanel…
Fr33dan
  • 4,227
  • 3
  • 35
  • 62
4
votes
1 answer

Listviews switch places

I have a winforms UserControl (UC) with a TableLayoutPanel (TLP). This panel has 2 columns and 1 row and is docked to fill the whole UC. Inside each column in the TLP I have a GroupBox, which is also set to dock.Fill. Last I have a ListView inside…
David Wakeman
  • 113
  • 1
  • 1
  • 6
4
votes
1 answer

RowStyles and Rows doesn't match in TableLayoutPanel?

We are hiding controls in a TableLayoutPanel. We have been using the following code for a while for hiding a row that shouldn't be visible. int controlRow = m_panel.GetPositionFromControl(control).Row; m_panel.RowStyles[controlRow].SizeType =…
Carl R
  • 8,104
  • 5
  • 48
  • 80
4
votes
2 answers

TableLayoutPanel only shows last row - C#

I've a TableLayoutPanel that has 10 rows and 2 columns. My problem is, when I add a label in the first column and a button in the other, everything is fine. But when I add another label and a button on e.g. the next row, the previous rows are empty.…
4
votes
1 answer

TableLayoutPanel remove empty rows

I'm trying to remove all empty rows from a TableLayoutPanel. So far I have been able to do it this way private void RemoveEmptyRows() { for (int row = 0; row < tablePanel.RowCount - 1; row++) { bool hasControl = false; for…
nilobarp
  • 3,806
  • 2
  • 29
  • 37
4
votes
1 answer

Why does 12 X 8.33 seem to equate to about 105?

In my TableLayoutPanel, I'm dynamically adding twelve rows (and several columns). When I had the TableLayoutPanel's Rows collection set to Autosize, the 12th row would be generated, but would not display. I changed it to Percentage, with each row…
B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862
4
votes
1 answer

How can I programmatically set the Column and Row properties of controls that are dynamically created to embed within a TableLayoutPanel?

When I drop a control, such as a Label or a TextBox, on a TableLayoutPanel, it has (among many others, of course) the following properties: Cell.Column Cell.Row Column Row ...but these controls don't normally have these properties (IOW, Labels and…
B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862