views:

322

answers:

1

I have a WPF label contained in a FlowLayoutPanel and I want to determine the position of the label when clicked with the mouse. I am trying to position a pop-up control where near to the label and just need it's location.

+2  A: 

The Popup control has this ability built-in. You can use the Placement, PlacementTarget, HorizontalOffset and VerticalOffset properties to control it.

That said, if you really want to find a point relative to another control, use the UIElement.TranslatePoint method.

HTH, Kent

Kent Boogaart