title: VB.NET collision between pictureboxes
body: <p>I'm trying to make a simple game and i need to know if picturebox1( my character) collides with other pictureboxes ( the walls).</p>
  
  <p>I have already worked out how do this but it only works with my character and 1 other picturebox for example:</p>
  
  <pre><code>If picturebox1.bounds.intersectWith(picturebox2.bounds) then
     collision = true
  end if
  </code></pre>
  
  <p>I tried to do something else like this:</p>
  
  <pre><code>For Each PictureBox In Me.Controls
    If PictureBox1.Bounds.IntersectsWith(PictureBox.Bounds) Then
       collision = True
    Else : collision = False
    End If
  Next
  </code></pre>
  
  <p>But then the boolean collision would always be true because picturebox1 (the character) always intersects with itself.</p>
  
  <p>So i changed the picturebox into a panel and the code looks the following:</p>
  
  <pre><code>For Each PictureBox In Me.Controls
    If Panel1.Bounds.IntersectsWith(PictureBox.Bounds) Then
       collision = True
    Else : collision = False
    End If
  Next
  </code></pre>
  
  <p>But it only works with 1 single picture box and not with all the pictureboxes in the form.
  I don't understand why...
  And if anyone maybe knows how to add an exception in the for each function so i can keep my picturebox1</p>
  
  <p>something like this maybe </p>
  
  <pre><code>For each picturebox(except(picturebox1)) in me.controls
  </code></pre>
  
  <p>because i've searched for that but didn't find anything...</p>
  
  <p>Any help is greatly appreciated :)
  Thanks!</p>