control array vb.net-Collection of common programming errors

VB.NET does not support control arrays, in the same sense as VB6. You can do similar things, though. For instance, if you want to handle events from multiple controls with the same method, you can do so like this:

Private Sub MyClickHandler(sender As Object, e As EventArgs) Handles _
    Button1.Click, _
    Button2.Click, _
    Button3.Click

    Dim buttonThatWasClicked As Button = CType(sender, Button)
    ' Do something...
End Sub

If you want to create an array of controls that you can loop through, you can do that to, like this:

Dim myTextBoxes() As TextBox = New TextBox() { TextBox1, TextBox2, TextBox3 }
For i As Integer = 0 to myTextBoxes.Length - 1
    myTextBoxes(i).Text = ...
Next

Alternatively, if you name your controls consistently, you can find them by name in your form’s Controls collection. For instance, if you had three text boxes named TextBox1, TextBox2, and TextBox3, you could loop through them like this:

For i As Integer = 1 to 3
    Dim t As TextBox = CType(Me.Controls("TextBox" & i.ToString()), TextBox)
    t.Text = ...
Next