Window ActualTop, ActualLeft

前端 未结 4 1202
小蘑菇
小蘑菇 2020-12-02 02:11

What is the correct way to retrieve a window\'s position in WPF?

Here\'s some attempts I made. First attempt, the obvious

Point GetPosition(Window wi         


        
4条回答
  •  时光说笑
    2020-12-02 02:38

    When the window is moved by the user, the Top and Left properties are not updated according to the change of location. But it is possible to use RestoreBounds.Top and RestoreBounds.Left as "ActualTop" and "ActualLeft". Ofcauce the maximized and minimized case is special, and must be treated separately

提交回复
热议问题