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?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Mike GoldRank #50 · 30.6K reputationPosted Mar 15, 2010, 10:05 PM EDT
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.
Jason24 reputationPosted Mar 21, 2010, 11:45 AM EDT