Hello,
I'm trying to create a tablelayoutpanel and to add some items to it.
This is my code:
Dim tabel As TableLayoutPanel
Sub tekenen()
'Tabel
tabel = New TableLayoutPanel
tabel.Location = New System.Drawing.Point(30, 100)
tabel.ColumnStyles.Clear()
tabel.ColumnStyles.Add(New ColumnStyle(SizeType.Absolute, My.Computer.Screen.WorkingArea.Width - 180 - 300 - 30))
tabel.ColumnStyles.Add(New ColumnStyle(SizeType.Absolute, 300))
tabel.ColumnStyles.Add(New ColumnStyle(SizeType.Absolute, 90))
tabel.ColumnStyles.Add(New ColumnStyle(SizeType.Absolute, 90))
tabel.RowStyles.Clear()
For i As Integer = 0 To aantalspelers - 1 'Consider 'aantalspelers' > 1
tabel.RowStyles.Add(New ColumnStyle(SizeType.Absolute, 75))
Dim label As New Label
Dim font As New Font("Tahoma", 10, FontStyle.Regular, GraphicsUnit.Pixel)
label.Font = font
label.Text = namen(i)
tabel.Controls.Add(label, 1, i)
Next
Controls.Add(tabel)
End Sub
This code doesn't work, it only shows a small, gray panel.
Help!