Here is how I do it, The first code is where I set up a textbox array and calls for a handle. The second cose is a sub for the handle
With txtFreqs(intL)
.Size = New Size(56, 25)
.Location = New Point(intTFX, intY)
.Enabled = False
.MaxLength = 6
.Name = "txtFreq" & intL.ToString
AddHandler txtFreqs(intL).KeyPress, AddressOf HandlesTextBox
End With
This handle is so someone can only write numbers and use the backspace
Private Sub HandlesTextBox(ByVal sender As Object, ByVal e As KeyPressEventArgs)
If Not Char.IsNumber(e.KeyChar) And Not Asc(e.KeyChar) = 8 Then
e.Handled = True
End If
End Sub
Hope this helps and steers you in the right direction for what you are looking for