Si I'm working on an assignment where I have 10 RadioButtons indicating how many contesters I have, and depending on what I pick between 1 to 10, I need that many of my corresponding TextBoxes to be enabled so I could fill it with names!
Is there a way for me to make a For loop between 1 and the number I picked from the RadioButton and say something like
For i = 0 to Size
TextBox&i.Enabled = True
You can iterate over all controls like this:
For Each ctr In Me.Controls Dim indx As String = ctr.Name If TypeOf (ctr) Is Textbox Then ' Now compare the name with TextBox&i and do smth End If Next