|
-
July 17th, 2011, 10:26 AM
#1
C# How to check if pictureBox1 touches pictureBox2
What I basically have at the moment is a pictureBox1, you can move it by clicking anywhere on the form and it slowly moves at that coordinate + 1 at a time with the timer every 10 milliseconds.
I created a pictureBox2, on the form which I want to act as a barrier.
Does anyone know the code to check if pictureBox1 touches pictureBox2, i used a code before but it only seemed to work if the pictureBox1 approached pictureBox2 from bottom probably because the x, y was on the top left hand corner, and it also worked with pic approaching from the right because of the pics top left hand corner touching the pic2.
But, what I need is a code that if pic1 touches any part of pic2 then pic1 stops in its position of my choice
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|