I have Labels inside a Canvas, I need to get the label that intersects with coordinates X,Y?
Thanks!!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Canvas.GetLeft(element), Canvas.GetTop(element) will get you any element’s position. Use ActualWidth and ActualHeight to form its complete rectangle. You can iterate through the Children of the Canvas with a foreach.
Edit: CodeNaked pointed out that elements might be set with SetRight or SetBottom so I modified the sample code: