title: Add values to multiple textboxes (similar names)
body: <p>I was trying to find the solution for this but nothing works. I have around 650 textboxes named : A001A, A002A...A600A and I would like to put values in those texboxes for instance "example value". </p>
  
  <p>I've found solution to put values in all textboxes in a form, but in mine there are those with some other values. </p>
  
  <p>Next solution is this one : </p>
  
  <pre><code>    Dim textBoxArr() As TextBox = {A2, A3, A4, A5, etc..}
  For Each tb As TextBox In textBoxArr
      Select Case tb.Text
          Case "RESNO"
              tb.Text = "-15,55,0"
          Case "DOGAL"
              tb.Text = "-15,54,0"
      End Select
  Next
  </code></pre>
  
  <p>...again I have to input all names and I don't have enough freedom to manipulate values for first 50 and so on.</p>
  
  <p>This is the code I have and it doesn't work: </p>
  
  <pre><code>For I As Integer = 0 To 650
      Dim txt As TextBox = DirectCast(Me.Controls("A00" &amp; I.ToString &amp; "A"), TextBox)
              txt.Text = "example value"
  Next
  </code></pre>
  
  <p><strong>error: object reference not set to an instance of an object</strong></p>
  
  <p>Thanks for the help.</p>
  
  <p><strong>EDIT : 
  I have found the solution from user Idle_Mind</strong></p>
  
  <pre><code>Dim matches() As Control
  For i As Integer = 1 To 650
      matches = Me.Controls.Find("A" &amp; String.Format("{0:000}", i) &amp; "A", True)
      If matches.Length &gt; 0 AndAlso TypeOf matches(0) Is TextBox Then
          Dim cb As TextBox = DirectCast(matches(0), TextBox)
          If cb.Text = "" Then
              cb.Text = "test"
          End If
      End If
  Next
  </code></pre>