开发者

WPF Window Position

开发者 https://www.devze.com 2023-01-02 07:53 出处:网络
How I can set the positi开发者_如何学Pythonon of the windows in the center of the screen in my XAML?

How I can set the positi开发者_如何学Pythonon of the windows in the center of the screen in my XAML?

Thank you.


Put this in your Window declaration in your XAML:

WindowStartupLocation="CenterScreen"


I agree with Otávio.
Also if you create a child window you can use:

WindowStartupLocation="CenterOwner" 

But you need to remember to set the Owner property of the child window to the parent window or the child window does not center properly.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号