PictureBoxes Intersection in C-sharp
Hello All.
I have just started to study C-Sharp and i'm having trouble checking if 2 picture boxes intersect each other.
I wrote this code:
if (pictureBox1.ClientRectangle.IntersectsWith(pictureBox2.ClientRectangle))
MessageBox.Show("PictureBoxes Intersect each other");
but the answer seems to be True always, even if the two pictureboxes are on other sides of the forum...
Please help me.
I am using Visual Studio 2008.
Thank you.
Re: PictureBoxes Intersection in C-sharp
Put a break point and check out the two ClientRectangle values. See if they are what you think they are. They maybe relative to the individual PictureBox... not sure... Check their values...