Adding controls to TableLayoutPanel dynamically during runtime

Use something like this:

Table.Controls.Add(new Label { Text = "Type:", Anchor = AnchorStyles.Left, AutoSize = true }, 0, 0);
Table.Controls.Add(new ComboBox { Dock = DockStyle.Fill }, 0, 1);

You don’t need to define number of rows and columns, they will be added automatically.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)