title: How To Get Control Property by "String Name"?
body: <p>i have been created buttons and textboxs by <strong>coding</strong> in next loop, 
  the result </p>
  
  <pre><code>'T(x).Name = "text_1"
  'T(x).Name = "text_2"
  'T(x).Name = "text_3"
  '....
  
  'B(x).Name = "button_1"
  'B(x).Name = "button_2"
  'B(x).Name = "button_3"
  '...
  </code></pre>
  
  <p>and i want to get textbox property whene i click the button,
  i can get button property when click like <code>button_1.Name.ToString</code>
  but i cant get the text_1,2,3 .... property.</p>
  
  <p>i do some trick by split function button_1.Name.ToString and get the last number 
  and add it to the textbox name like <code>"text_" &amp; button_1.Name.ToString</code> but i can't convert this string to object.</p>
  
  <p><strong>Update</strong></p>
  
  <p>Here's the code I'm using to load the controls in the loop:</p>
  
  <pre><code>C_A_TEXT(x) = New TextBox() 
  C_A_TEXT(x).Dock = System.Windows.Forms.DockStyle.Fill 
  C_A_TEXT(x).Location = New System.Drawing.Point(270, 5) 
  C_A_TEXT(x).Margin = New System.Windows.Forms.Padding(0) 
  C_A_TEXT(x).Size = New System.Drawing.Size(70, 27) 
  C_A_TEXT(x).TabIndex = 5 
  C_A_TEXT(x).Name = "NEW_RECHARGE_COUNT_TEXT_" &amp; x
  </code></pre>
  
  <p><strong>Update 2</strong></p>
  
  <p>Here's some more code:</p>
  
  <pre><code>AddHandler C_A_BUTTONS(x).Click, AddressOf C_A_BUTTON 
  
  Private Sub C_A_BUTTON(ByVal sender As System.Object, ByVal e As System.EventArgs) 
      Dim thisButton As Button = sender Dim A = CType(Me.Controls("NEW_RECHARGE_COUNT_TEXT_1"), TextBox) 
      MsgBox(A.Text.ToString)  'Error!
  End Sub
  </code></pre>