I am trying to programmatically organize from top to down a pair of label-textbox using a flowlayoutpanel. What I am trying to get is similar to the following image:
so I have implemented below code (I need to create 254 label-textbox pair):
Dim lbl As Label
Dim txt As TextBox
Dim flowLayout As FlowLayoutPanel
For i As Integer = 0 To 253
lbl = New Label
lbl.Text = i.ToString("000") + ":"
lbl.Padding = New Padding(0)
lbl.Margin = New Padding(0)
txt = New TextBox
txt.Text = "<" + i.ToString.PadLeft(3, " ") + ">"
txt.MaxLength = 5
txt.Margin = New Padding(0)
txt.Size = New Size(39, 20)
flowLayout = New FlowLayoutPanel
flowLayout.FlowDirection = FlowDirection.LeftToRight
flowLayout.Controls.Add(lbl)
flowLayout.Controls.Add(txt)
flowLayout.Padding = New Padding(0)
flowLayout.Margin = New Padding(0)
Me.FlowLayoutPnl.Controls.Add(flowLayout)
Next
but using above code I am getting below:
Any ideas?