I want to set Textbox1 to textbox 55 to .readonly =true by using says For loop,so i need not key in one by one. Any ways to do it?

I know sonthing like

For index As Integer = 1 To 55
            Me.b.Controls("Textbox" & index).Text = index
            Me.b.Controls("Textbox" & index).TabIndex = index
               Me.b.Controls("Textbox" & index). = index

but inside .control doesnt have .readonly.....Any similiar command or ways to do it?
Thanks in advance


.enabled = false


You can work around and use enabled and set backcolor to white.
Here's an example:

For Each ctrl As Control In Me.Controls
            If TypeOf ctrl Is TextBox Then
                ctrl.Enabled = False
                ctrl.BackColor = Color.White
            End If

>How to set Multiple textbox property's Readonly

For Each t As TextBox In Me.Controls.OfType(Of TextBox)()
 t.ReadOnly = True

I was going to ask a similar question, so that helps me a lot too, thanks.