For i As Integer = 0 To 10
Dim tb As New TextBox()
tb.Location = New System.Drawing.Point(40, 120 + i * 20)
tb.Name = "TextBoxName" & i.ToString()
tb.Size = New System.Drawing.Size(184, 20)
tb.TabIndex = i + 2
tb.Text = [String].Empty
Me.Controls.Add(tb)
Next
Private textboxes As ArrayList
Private Tboxes As Integer = 3
Private Sub Method2()
Dim i As Integer = 0
Me.textboxes = New ArrayList()
For i = 0 To Tboxes - 1
Me.textboxes.Add(New TextBox())
DirectCast(Me.textboxes(i), TextBox).Location = New System.Drawing.Point(40, 36 + i * 20)
DirectCast(Me.textboxes(i), TextBox).Name = "TextBoxName" & i.ToString()
DirectCast(Me.textboxes(i), TextBox).Size = New System.Drawing.Size(184, 20)
DirectCast(Me.textboxes(i), TextBox).TabIndex = i + 2
DirectCast(Me.textboxes(i), TextBox).Text = [String].Empty
Me.Controls.Add(DirectCast(Me.textboxes(i), TextBox))
Next
End Sub