How to detect a picturebox is on a drawn line?
I have a line drawn in windows form and would like to detect if a picturebox is placed there?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
JasonPosted Mar 21, 2010, 3:45 PM
Mike GoldPosted Mar 16, 2010, 2:05 AM
If its a horizontal line and you want to know if the picturebox was placed on top, then check the (Location + Bounds).Bottom is near the line y coordinates and check if the left and right bounds + Location of the picture box fall in between the two x coordinates of the line.