title: How do I concatenate a Control name with a value inside another variable?
body: <p>The question is it. I have some textboxes, from 0 to 10 (Example: txt0, txt1, txt2...), and I want to use a &quot;for&quot; instruction to refer to each text box... I was trying this:</p>
  <pre><code>Dim Value As Double
  Value = CInt(txt10.Text)
  Value -= CInt(txt0.Text)
  Value /= 10
  
  For i As Integer = 1 To 9 '(Here I just want to refer from the txt1 to txt9)
     (txt &amp; i).text = Value * i + CInt(txt0.Text)
  Next
  </code></pre>
  <p>Right now I have this repeated code instead of for:</p>
  <pre><code>txt1.Text = Value * 1 + CInt(txt0.Text)
  txt2.Text = Value * 2 + CInt(txt0.Text)
  txt3.Text = Value * 3 + CInt(txt0.Text)
  txt4.Text = Value * 4 + CInt(txt0.Text)
  txt5.Text = Value * 5 + CInt(txt0.Text)
  txt6.Text = Value * 6 + CInt(txt0.Text)
  txt7.Text = Value * 7 + CInt(txt0.Text)
  txt8.Text = Value * 8 + CInt(txt0.Text)
  txt9.Text = Value * 9 + CInt(txt0.Text)
  </code></pre>