I am trying to add a TableLayoutPanel to my form at runtime. I have the following code which works (suggestions for improvements are welcome.)
What I cannot figure out is how to set the row heights and column widths. I think it needs some form of FOR EACH loop but I cannot find the right code to reference the rows and columns. I have tried this code:
but it only affects the first row and I can't find any way to index it.
Any help will be appreciated. And btw - once I get this, I will need to address each of the cells individually.
Thanks
Code:
Dim myTable As New TableLayoutPanel
myTable.Name = "myTable1"
myTable.RowCount = 10
myTable.ColumnCount = 10
myTable.CellBorderStyle = TableLayoutPanelCellBorderStyle.Inset
myTable.Location = New Point(100, 100)
Controls.Add(myTable)
Code:
myTable.RowStyles.Add(New RowStyle(SizeType.Absolute, 30))
Any help will be appreciated. And btw - once I get this, I will need to address each of the cells individually.
Thanks