我正在尝试创建标签和文本框列表。没有错误,但它们没有呈现在表单上。我已经确认我的循环有值
Private Sub AddLabels_Load(sender As Object, e As EventArgs) Handles MyBase.Load
'MsgBox(strNumberOfLabels + " " + strOrderNum)
TableLayoutPanel1.AutoSize = True
TableLayoutPanel1.Visible = False
TableLayoutPanel1.SuspendLayout()
For i As Integer = 0 To strNumberOfLabels
'MsgBox(i)
Dim txtBox As New TextBox
Dim txtLabel As New Label
txtLabel.Text = "Label " + i
txtBox.Name = "txt" + i
TableLayoutPanel1.Controls.Add(txtLabel)
txtLabel.Show()
txtBox.Show()
TableLayoutPanel1.ResumeLayout()
TableLayoutPanel1.Visible = True
Next
End Sub