Getting the top left coordinates of a WPF UIElement

后端 未结 2 711
不知归路
不知归路 2021-01-11 10:44

I am working on extending the Microsoft resize Adorner example and need to be able to reposition the element after say the bottom left drag handle has been drag

2条回答
  •  梦毁少年i
    2021-01-11 11:29

    And if someone just wants the control's screen coordinates:

    Point targetLoc = targetCtrl.PointToScreen(new Point(0, 0));
    

    (this doesn't match the thread's description, but it does match the title. Figured it might help people coming in off search results)

提交回复
热议问题