You can use the controls collection and controls count property to loop through the controls on the form provided they are on the top level of the form.
For I = 0 To MyForm.Controls.Count - 1
'control code here,
Next
But if they are contained in a group box or other container then you have to loop through the container, then the container's container and so on. Below is a routine I use to change set colors of text boxes, combo boxes and list boxes to User options when they are on the top level or within group boxes, tab contros, panels, etc. You could modifiy it to enable and disable your text box by making a few changes.
Public Sub SetControlColor(ByVal X As Form)
Dim I, J, K, M As Integer
Dim T, L, G, P, C, B, V As System.Type
Dim Tbox As New TextBox
Dim Lbox As New ListBox
Dim Cbox As New ComboBox
Dim Pbox As New Panel
Dim Gbox As New GroupBox
Dim Bbox As New TabControl
Dim Vbox As New TabPage
T = Tbox.GetType()
L = Lbox.GetType()
C = Cbox.GetType()
G = Gbox.GetType()
P = Pbox.GetType()
B = Bbox.GetType()
V = Vbox.GetType()
Dim S As String
S = T.ToString
For I = 0 To X.Controls.Count - 1
'on the form itself
setTextListColors(X.Controls(I), T, L, C)
If (X.Controls(I).GetType Is G) Or (X.Controls(I).GetType Is P) Then
'in containers on forms
For J = 0 To X.Controls(I).Controls.Count - 1
If (X.Controls(I).Controls(J).GetType Is G) Or (X.Controls(I).Controls(J).GetType Is P) Then
'in container (G or P) in container (G or P)
For K = 0 To X.Controls(I).Controls(J).Controls.Count - 1
setTextListColors(X.Controls(I).Controls(J).Controls(K), T, L, C)
Next
Else
'in the container (G or P)
setTextListColors(X.Controls(I).Controls(J), T, L, C)
End If
Next
ElseIf (X.Controls(I).GetType Is B) Then
'on tab control
For J = 0 To X.Controls(I).Controls.Count - 1
'on the tab itself
setTextListColors(X.Controls(I).Controls(J), T, L, C)
If (X.Controls(I).Controls(J).GetType Is V) Then
For K = 0 To X.Controls(I).Controls(J).Controls.Count - 1
setTextListColors(X.Controls(I).Controls(J).Controls(K), T, L, C)
If (X.Controls(I).Controls(J).Controls(K).GetType Is G) Or (X.Controls(I).Controls(J).Controls(K).GetType Is P) Then
'in containers on tab controls
For M = 0 To X.Controls(I).Controls(J).Controls(K).Controls.Count - 1
setTextListColors(X.Controls(I).Controls(J).Controls(K).Controls(M), T, L, C)
Next
End If
Next
End If
Next
End If
Next
Tbox.Dispose()
Lbox.Dispose()
Gbox.Dispose()
Pbox.Dispose()
Cbox.Dispose()
Bbox.Dispose()
Vbox.Dispose()
End Sub