title: Visual Basic - picturebox name variable increment
body: <p>Is there a way to set the image from one PictureBox object to another?  For example:</p>
  
  <pre><code>pictureboxA1.image = pictureboxB1.image
  pictureboxA2.image = pictureboxB2.image
  pictureboxA3.image = pictureboxB3.image
  </code></pre>
  
  <p>I did a similar thing with TextBox controls, but this code isn't working for me:</p>
  
  <pre><code>For i = 0 To 2
    Me.Controls("picturebox" + "A" &amp; i + 1).image = Me.Controls("picturebox" + "B" &amp; i + 1).image
  Next i
  </code></pre>
  
  <p>When I run this, I get an error stating <code>.image is not a member of 'System.Windows.Forms.Control'</code>.</p>
  
  <hr>
  
  <p>i know that is pictureboxA1.image = pictureboxB1.image.</p>
  
  <p>but if i try like this </p>
  
  <pre><code>For i = 0 To 2
    Me.Controls("picturebox" + "A" &amp; i + 1).image = Me.Controls("picturebox" + "B" &amp; i + 1).image
  Next i
  </code></pre>
  
  <p>it says that image is not a member of controls.
  because i have to do this pictureboxA1.image = pictureboxB1.image, 21 times.</p>
  
  <p>like 
  pictureboxA1, pictureboxA2, ... 3, 4, 5, 6, 7 until 21.</p>
  
  <p>and if i do it like this </p>
  
  <pre><code>pictureboxA1.image = pictureboxB1.image
  </code></pre>
  
  <p>i have to right the code 21 times and if i do it with for its just one time xD.</p>
  
  <p>and i tryed .picture it says the same thing</p>